android.widget.ScrollView.setBackgroundColor()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(96)

本文整理了Java中android.widget.ScrollView.setBackgroundColor()方法的一些代码示例,展示了ScrollView.setBackgroundColor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ScrollView.setBackgroundColor()方法的具体详情如下:
包路径:android.widget.ScrollView
类名称:ScrollView
方法名:setBackgroundColor

ScrollView.setBackgroundColor介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

ScrollView scroll = new ScrollView(context);
scroll.setBackgroundColor(android.R.color.transparent);
scroll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
                       LayoutParams.FILL_PARENT));
scroll.addView(yourTableView);

代码示例来源:origin: palaima/DebugDrawer

sliderLayout.setBackgroundColor(sliderBackgroundColor);
} else if (sliderBackgroundColorRes != -1) {
  sliderLayout.setBackgroundColor(activity.getResources().getColor(sliderBackgroundColorRes));
} else if (sliderBackgroundDrawable != null) {
  UIUtils.setBackground(sliderLayout, sliderBackgroundDrawable);

代码示例来源:origin: stackoverflow.com

ScrollView scroll = new ScrollView(context);
scroll.setBackgroundColor(android.R.color.transparent);
scroll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
                       LayoutParams.FILL_PARENT));
scroll.addView(yourLinearLayout);

代码示例来源:origin: stackoverflow.com

ScrollView scroll = new ScrollView(context);
scroll.setBackgroundColor(android.R.color.transparent);
scroll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
                       LayoutParams.FILL_PARENT));
scroll.addView(yourview);

代码示例来源:origin: stackoverflow.com

ScrollView scroll = new ScrollView(context);
scroll.setBackgroundColor(android.R.color.transparent);
scroll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
                       LayoutParams.FILL_PARENT));

table.addView(tableRow1);
scroll.addView(table);
  setContentView(scroll);

代码示例来源:origin: stackoverflow.com

ScrollView scrollview = new ScrollView(context);
scrollview.setBackgroundColor(android.R.color.transparent);
scrollview.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
                       LayoutParams.FILL_PARENT));
scrollview.addView(tableLayout);

代码示例来源:origin: first087/Android-License-Fragment

@Override
protected void onRestoreState(Bundle savedInstanceState) {
  scrollView.setBackgroundColor(customUI.getTitleBackgroundColor());
  tvLicense.setTextColor(customUI.getTitleTextColor());
}

代码示例来源:origin: stackoverflow.com

ScrollView scroll = new ScrollView(yourContext);
scroll.setBackgroundColor(android.R.color.transparent);
scroll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
scroll.addView(yourView);

代码示例来源:origin: stackoverflow.com

ScrollView scroll = new ScrollView(context);
scroll.setBackgroundColor(android.R.color.transparent);
scroll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
scroll.addView(yourTableView);

代码示例来源:origin: stackoverflow.com

public class ListTestActivity extends Activity {
LinearLayout layout;
ScrollView myScrollView;
TextView textview;

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);

  layout = (LinearLayout) this.findViewById(R.id.linearLayout1);

  myScrollView = new ScrollView(this);
  myScrollView.setBackgroundColor(0xfff00fff);
  myScrollView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));

  textview = new TextView(this);
  textview.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
  textview.setText("sadfasdfasdfasdfasdfasd fasdfsadfsadf");

  myScrollView.addView(textview);
  layout.addView(myScrollView);
}}

代码示例来源:origin: stackoverflow.com

//Create the ScrollView
ScrollView scroll = new ScrollView(this);
scroll.setBackgroundColor(android.R.color.transparent);
scroll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
                       LayoutParams.FILL_PARENT));

//Get the base layout for your Activity and add the scroll view to it.
ViewGroup root = (ViewGroup)findViewById(R.id.content);
root.addView(scroll);

//Add your layout here which contains the EditText, Spinner and RadioButton and CheckBox.
scroll.addView(yourExistingLayout);

代码示例来源:origin: leeowenowen/rxjava-examples

private void setupUIComponents() {
 mContainer = new LinearLayout(this);
 mContainer.setOrientation(LinearLayout.VERTICAL);
 mDescription = new TextView(this);
 mDescription.setBackgroundColor(Color.BLUE);
 mDescription.setTextColor(Color.YELLOW);
 mDescription.setText(myDescription());
 mContainer.addView(mDescription,
           new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,  LinearLayout.LayoutParams.WRAP_CONTENT));
 mWorkspace = new LinearLayout(this);
 setupWorkspace(mWorkspace);
 mContainer.addView(mWorkspace,
           new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
                          LinearLayout.LayoutParams.WRAP_CONTENT));
 mTip = new TextView(this);
 mTip.setSingleLine(false);
 appendTip("Messages:(Scroll to show more ...)");
 ScrollView scrollView = new ScrollView(this);
 scrollView.setBackgroundColor(Color.GRAY);
 scrollView.addView(mTip);
 mContainer.addView(scrollView,
           new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0, 1));
 setContentView(mContainer);
}

代码示例来源:origin: first087/Android-License-Fragment

@Override
protected void onFirstTimeLaunched(ArrayList<License> licenses) {
  scrollView.setBackgroundColor(customUI.getTitleBackgroundColor());
  tvLicense.setTextColor(customUI.getTitleTextColor());
  tvLicense.setText("");
  for (License license : licenses) {
    tvLicense.append("-------------------------\n");
    tvLicense.append(license.getTitle() + "\n");
    tvLicense.append("-------------------------\n");
    tvLicense.append(license.getLicense() + "\n\n");
  }
}

代码示例来源:origin: quaap/LaunchTime

private void initializeActionMenu() {
  mScreenDim = mMain.getScreenDimensions();
  mShortcutActionsList.removeAllViews();
  mItemBGColor = mStyle.getCattabBackground();
  int textcolor = mStyle.getCattabTextColor();
  int bgcolor = mStyle.getCalculatedWallpaperColor();
  if (Color.alpha(bgcolor) > 90) {
    int red = Color.red(bgcolor);
    int green = Color.green(bgcolor);
    int blue = Color.blue(bgcolor);
    int alpha = 200;
    if (Color.alpha(mItemBGColor)<120) alpha = 235;
    bgcolor = Color.argb(alpha, red, green, blue);
  } else {
    bgcolor = Color.argb(235, 128, 128, 128);
    mItemBGColor = Color.argb(240, 255-Color.red(textcolor), 255-Color.green(textcolor), 255-Color.blue(textcolor));
  }
  int red = Color.red(bgcolor);
  int green = Color.green(bgcolor);
  int blue = Color.blue(bgcolor);
  bgcolor = Color.argb(220, red<200?red+10:red, green<200?green+10:green, blue<200?blue+20:blue);
  mShortcutActionsPopup.setBackgroundColor(bgcolor);
  if (mStyle.isRoundedTabs()) {
    mShortcutActionsPopup.setBackground(mStyle.getBgDrawableFor(mShortcutActionsPopup, bgcolor));
  }
  mIconBar = null;
}

代码示例来源:origin: stackoverflow.com

ScrollView sv = new ScrollView(this);
 sv.setBackgroundColor(Color.parseColor("#394343"));
 LinearLayout linearLayout = new LinearLayout(this);
 linearLayout.setLayoutParams(new LinearLayout.LayoutParams(
     LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
 linearLayout.setGravity(Gravity.CENTER);
 linearLayout.setOrientation(LinearLayout.VERTICAL);
 linearLayout.setBackgroundColor(Color.parseColor("#E7E7E7"));
 sv.addView(linearLayout);
 Button datos_OK = new Button(this);
 datos_OK.setText("Aceptar");
 LinearLayout.LayoutParams testLP = new LinearLayout.LayoutParams(
     LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
 testLP.setLayoutDirection(Gravity.CENTER);
 datos_OK.setLayoutParams(testLP);
 datos_OK.setBackgroundResource(R.drawable.ic_delete);
 datos_OK.setTextColor(Color.WHITE);
 linearLayout.addView(datos_OK);

代码示例来源:origin: leeowenowen/rxjava-examples

ScrollView topScrollView = new ScrollView(this);
topScrollView.addView(mTop);
topScrollView.setBackgroundColor(Color.WHITE);
container.addView(topScrollView,
         new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0, 3));

代码示例来源:origin: dkanada/frost

baseScroller.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
setContentView(baseScroller);
baseScroller.setVisibility(View.VISIBLE);

代码示例来源:origin: dkanada/frost

baseScroller.setBackgroundColor(getResources().getColor(R.color.colorLight));
setContentView(baseScroller);
baseScroller.setVisibility(View.VISIBLE);

代码示例来源:origin: stackoverflow.com

scrollView.setBackgroundColor(Color.BLUE);

代码示例来源:origin: KishanV/Android-Music-Player

private void init() {
  sc = new ScrollView(getContext());
  sc.setLayoutParams(new FrameLayout.LayoutParams(Ui.cd.DPW+ Ui.cd.DPW, Ui.cd.DPH));
  sc.setBackgroundColor(0x00FFFFFF);
  addView(sc);
  main = new FMlyt(getContext(), Ui.cd.DPW, Ui.cd.DPH);
  main.setBackgroundColor(0x00000000);
  sc.addView(main,new ScrollView.LayoutParams(Ui.cd.DPW, Ui.cd.DPH));
  FMView back = new FMView(getContext(), Ui.cd.DPW, Ui.cd.DPH+ Ui.cd.DPH);
  back.setLayerType(LAYER_TYPE_SOFTWARE,null);
  main.addView(back);
  ShapeView titleback = titleBackground.getFMview(getContext(),false);
  titleback.setSize(Ui.cd.DPW, Ui.cd.getHt(60));
  main.addView(titleback);
  FMText titleText = textImg.getFMText(getContext() ,"AUDIO EQULIZERS", Ui.cd.getHt(18));
  titleText.img.setColor(0x66FFFFFF);
  titleText.InCenter(Ui.cd.DPW, Ui.cd.getHt(60));
  main.addView(titleText);
  int top = Ui.cd.getHt(60);
  top = bassFn(top);
  top = verchulizerFn(top);
  top = eqlizerFn(top);
  back.setSize(back.width,top);
}

相关文章

ScrollView类方法