本文整理汇总了Java中android.widget.ScrollView.setBackgroundColor方法的典型用法代码示例。如果您正苦于以下问题:Java ScrollView.setBackgroundColor方法的具体用法?Java ScrollView.setBackgroundColor怎么用?Java ScrollView.setBackgroundColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ScrollView
的用法示例。
在下文中一共展示了ScrollView.setBackgroundColor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.widget.ScrollView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
FrameLayout layout = new FrameLayout(this);
TextView help_view = new TextView(this);
help_view.setTextSize(18);
help_view.setBackgroundColor(0xFFFFFFFF);
help_view.setTextColor(0xFF000000);
help_view.setText(R.string.help);
ScrollView scroll_view = new ScrollView(this);
scroll_view.setBackgroundColor(0xFFFFFFFF);
scroll_view.addView(help_view);
layout.addView(scroll_view);
setContentView(layout);
}
示例2: createLayout
import android.widget.ScrollView; //导入方法依赖的package包/类
private void createLayout(int width) {
float scale = IceScreenUtils.densityScale(getApplicationContext());
int margin = 16 * Math.round(scale);
LinearLayout.LayoutParams baseParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
LinearLayout.LayoutParams containerParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
LinearLayout.LayoutParams imageParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1f);
ScrollView baseScroller = new ScrollView(this);
baseScroller.setLayoutParams(baseParams);
baseScroller.setBackgroundColor(0xff000000);
setContentView(baseScroller);
baseScroller.setVisibility(View.VISIBLE);
// display width hack
Rect windowRect = new Rect();
baseScroller.getWindowVisibleDisplayFrame(windowRect);
int windowWidth = windowRect.right - windowRect.left;
LinearLayout baseLayout = new LinearLayout(this);
baseLayout.setOrientation(LinearLayout.VERTICAL);
baseLayout.setLayoutParams(layoutParams);
baseLayout.setPadding(margin, margin, 0, 0);
baseScroller.addView(baseLayout);
String[] images = getResources().getStringArray(R.array.icon_pack);
for (int i = 0; i < images.length; i++) {
if ((i % width) == 0) {
layoutList.add((i / width), new LinearLayout(this));
layoutList.get(i / width).setOrientation(LinearLayout.HORIZONTAL);
layoutList.get(i / width).setGravity(Gravity.LEFT);
layoutList.get(i / width).setLayoutParams(containerParams);
baseLayout.addView(layoutList.get(i / width));
}
imageList.add(i, new ImageView(this));
imageList.get(i).setLayoutParams(imageParams);
imageList.get(i).setScaleType(ImageView.ScaleType.FIT_XY);
imageList.get(i).setPadding(0, 0, margin, margin);
IceImageUtils.bitmapLoadAsync(imageList.get(i), getApplicationContext(), getApplicationContext().getResources(), "nodpi_" + images[i], (windowWidth / width) - (margin * width + margin) / width, (windowWidth / width) - (margin * width + margin) / width);
imageList.get(i).setAdjustViewBounds(true);
layoutList.get(i / width).addView(imageList.get(i));
}
}
示例3: initContentView
import android.widget.ScrollView; //导入方法依赖的package包/类
protected View initContentView(Context context, AttributeSet attrs, int defStyleAttr) {
ScrollView scrollView = new ScrollView(context);
llContainer = new LinearLayout(context);
llContainer.setOrientation(LinearLayout.VERTICAL);
scrollView.addView(llContainer, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
scrollView.setBackgroundColor(Color.WHITE);
return scrollView;
}
示例4: init
import android.widget.ScrollView; //导入方法依赖的package包/类
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);
}
示例5: createLayout
import android.widget.ScrollView; //导入方法依赖的package包/类
private void createLayout(int width) {
float scale = IceScreenUtils.densityScale(getApplicationContext());
int margin = 16 * Math.round(scale);
LinearLayout.LayoutParams baseParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
LinearLayout.LayoutParams containerParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
LinearLayout.LayoutParams imageParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1f);
ScrollView baseScroller = new ScrollView(this);
baseScroller.setLayoutParams(baseParams);
baseScroller.setBackgroundColor(0xffffffff);
setContentView(baseScroller);
baseScroller.setVisibility(View.VISIBLE);
// display width hack
Rect windowRect = new Rect();
baseScroller.getWindowVisibleDisplayFrame(windowRect);
int windowWidth = windowRect.right - windowRect.left;
LinearLayout baseLayout = new LinearLayout(this);
baseLayout.setOrientation(LinearLayout.VERTICAL);
baseLayout.setLayoutParams(layoutParams);
baseLayout.setPadding(margin, margin, 0, 0);
baseScroller.addView(baseLayout);
String[] wallpapers = getResources().getStringArray(R.array.wallpapers);
for (int i = 0; i < wallpapers.length; i++) {
if ((i % width) == 0) {
layoutList.add((i / width), new LinearLayout(this));
layoutList.get(i / width).setOrientation(LinearLayout.HORIZONTAL);
layoutList.get(i / width).setGravity(Gravity.LEFT);
layoutList.get(i / width).setLayoutParams(containerParams);
baseLayout.addView(layoutList.get(i / width));
}
imageList.add(i, new ImageView(this));
imageList.get(i).setLayoutParams(imageParams);
imageList.get(i).setScaleType(ImageView.ScaleType.FIT_XY);
imageList.get(i).setPadding(0, 0, margin, margin);
IceImageUtils.bitmapLoadAsync(imageList.get(i), getApplicationContext(), getApplicationContext().getResources(), wallpapers[i], (windowWidth / width) - (margin * width + margin) / width, (windowWidth / width) - (margin * width + margin) / width);
imageList.get(i).setAdjustViewBounds(true);
final Integer tempId = getResources().getIdentifier(wallpapers[i], "drawable", getPackageName());
imageList.get(i).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
wallpaperView(tempId);
}
});
layoutList.get(i / width).addView(imageList.get(i));
}
}