本文整理匯總了Java中android.widget.HorizontalScrollView.setBackgroundColor方法的典型用法代碼示例。如果您正苦於以下問題:Java HorizontalScrollView.setBackgroundColor方法的具體用法?Java HorizontalScrollView.setBackgroundColor怎麽用?Java HorizontalScrollView.setBackgroundColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.HorizontalScrollView
的用法示例。
在下文中一共展示了HorizontalScrollView.setBackgroundColor方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initContentView
import android.widget.HorizontalScrollView; //導入方法依賴的package包/類
protected View initContentView(Context context, AttributeSet attrs, int defStyleAttr) {
ForumThreadViewStyle viewstyle = getForumThreadViewStyle();
if(viewstyle == null) {
viewstyle = new ForumThreadViewStyle();
}
if(viewstyle.idMenuTabHeight == null) {
viewstyle.idMenuTabHeight = ResHelper.getResId(context, "dimen", "bbs_menu_tab_height");
}
tabHeight = getResources().getDimensionPixelSize(viewstyle.idMenuTabHeight);
LinearLayout llContent = new LinearLayout(context, attrs, defStyleAttr);
llContent.setBackgroundColor(getResources().getColor(ResHelper.getColorRes(getContext(), "bbs_white")));
llContent.setOrientation(LinearLayout.VERTICAL);
hsvContent = new HorizontalScrollView(context);
if(viewstyle.idMenuTabBg == null) {
viewstyle.idMenuTabBg = ResHelper.getColorRes(context, "bbs_menu_tab_bg");
}
hsvContent.setBackgroundColor(context.getResources().getColor(viewstyle.idMenuTabBg));
hsvContent.setHorizontalScrollBarEnabled(false);
hsvContent.setFillViewport(true);
slidingTabStrip = new SlidingTabStrip(context);
initTabStrip();
hsvContent.addView(slidingTabStrip, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
LinearLayout.LayoutParams llp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, tabHeight);
llContent.addView(hsvContent, llp);
View divider = new View(context);
if(viewstyle.idMenuTabDividerColor == null) {
viewstyle.idMenuTabDividerColor = ResHelper.getColorRes(context, "bbs_divider");
}
divider.setBackgroundColor(context.getResources().getColor(viewstyle.idMenuTabDividerColor));
if(viewstyle.idMenuTabDividerHeight == null) {
viewstyle.idMenuTabDividerHeight = ResHelper.getResId(context, "dimen", "bbs_menu_tab_divider_height");
}
llp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
getResources().getDimensionPixelSize(viewstyle.idMenuTabDividerHeight));
llContent.addView(divider, llp);
viewPager = buildViewPager();
llp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 0);
llp.weight = 1;
llContent.addView(viewPager, llp);
return llContent;
}