本文整理汇总了Java中android.widget.HorizontalScrollView.setHorizontalScrollBarEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java HorizontalScrollView.setHorizontalScrollBarEnabled方法的具体用法?Java HorizontalScrollView.setHorizontalScrollBarEnabled怎么用?Java HorizontalScrollView.setHorizontalScrollBarEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.HorizontalScrollView
的用法示例。
在下文中一共展示了HorizontalScrollView.setHorizontalScrollBarEnabled方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: NavitationScrollLayout
import android.widget.HorizontalScrollView; //导入方法依赖的package包/类
public NavitationScrollLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
margleft = dip2px(context, 0);
titleLayout = new LinearLayout(context);
LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
titleLayout.setLayoutParams(layoutParams);
titleLayout.setOrientation(LinearLayout.HORIZONTAL);
titleLayout.setGravity(Gravity.CENTER_VERTICAL);
LayoutParams layoutParams2 = new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
horizontalScrollView = new HorizontalScrollView(context);
horizontalScrollView.addView(titleLayout, layoutParams2);
horizontalScrollView.setHorizontalScrollBarEnabled(false);
addView(horizontalScrollView);
}
示例2: init
import android.widget.HorizontalScrollView; //导入方法依赖的package包/类
private void init() {
setVisibility(GONE);
/**
* Инициализация и настройка корневого view group
*/
View view = View.inflate(getContext(), R.layout.layout_expert_view, null);
container = ButterKnife.findById(view, R.id.container);
HorizontalScrollView scrollView = ButterKnife.findById(view, R.id.scrollView);
container.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
callback.onChooseExpert(new DetailsExpert(null));
}
});
scrollView.setHorizontalScrollBarEnabled(false);
addView(view);
}
示例3: getPlatformList
import android.widget.HorizontalScrollView; //导入方法依赖的package包/类
private LinearLayout getPlatformList() {
LinearLayout llToolBar = new LinearLayout(getContext());
LayoutParams lpTb = new LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
llToolBar.setLayoutParams(lpTb);
TextView tvShareTo = new TextView(getContext());
int resId = getStringRes(activity, "share_to");
if (resId > 0) {
tvShareTo.setText(resId);
}
tvShareTo.setTextColor(0xffcfcfcf);
tvShareTo.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
int dp_9 = dipToPx(getContext(), 9);
LayoutParams lpShareTo = new LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lpShareTo.gravity = Gravity.CENTER_VERTICAL;
lpShareTo.setMargins(dp_9, 0, 0, 0);
tvShareTo.setLayoutParams(lpShareTo);
llToolBar.addView(tvShareTo);
HorizontalScrollView sv = new HorizontalScrollView(getContext());
sv.setHorizontalScrollBarEnabled(false);
sv.setHorizontalFadingEdgeEnabled(false);
LayoutParams lpSv = new LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lpSv.setMargins(dp_9, dp_9, dp_9, dp_9);
sv.setLayoutParams(lpSv);
llToolBar.addView(sv);
llPlat = new LinearLayout(getContext());
llPlat.setLayoutParams(new HorizontalScrollView.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
sv.addView(llPlat);
return llToolBar;
}
示例4: getPlatformList
import android.widget.HorizontalScrollView; //导入方法依赖的package包/类
private LinearLayout getPlatformList() {
LinearLayout llToolBar = new LinearLayout(getContext());
LinearLayout.LayoutParams lpTb = new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
llToolBar.setLayoutParams(lpTb);
TextView tvShareTo = new TextView(getContext());
int resId = getStringRes(activity, "share_to");
if (resId > 0) {
tvShareTo.setText(resId);
}
tvShareTo.setTextColor(0xffcfcfcf);
tvShareTo.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
int dp_9 = dipToPx(getContext(), 9);
LinearLayout.LayoutParams lpShareTo = new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lpShareTo.gravity = Gravity.CENTER_VERTICAL;
lpShareTo.setMargins(dp_9, 0, 0, 0);
tvShareTo.setLayoutParams(lpShareTo);
llToolBar.addView(tvShareTo);
HorizontalScrollView sv = new HorizontalScrollView(getContext());
sv.setHorizontalScrollBarEnabled(false);
sv.setHorizontalFadingEdgeEnabled(false);
LinearLayout.LayoutParams lpSv = new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lpSv.setMargins(dp_9, dp_9, dp_9, dp_9);
sv.setLayoutParams(lpSv);
llToolBar.addView(sv);
llPlat = new LinearLayout(getContext());
llPlat.setLayoutParams(new HorizontalScrollView.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
sv.addView(llPlat);
return llToolBar;
}
示例5: getPlatformList
import android.widget.HorizontalScrollView; //导入方法依赖的package包/类
private LinearLayout getPlatformList() {
LinearLayout llToolBar = new LinearLayout(getContext());
llToolBar.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
TextView tvShareTo = new TextView(getContext());
int resId = R.getStringRes(this.activity, "share_to");
if (resId > 0) {
tvShareTo.setText(resId);
}
tvShareTo.setTextColor(-3158065);
tvShareTo.setTextSize(1, 18.0f);
int dp_9 = R.dipToPx(getContext(), 9);
LinearLayout.LayoutParams lpShareTo = new LinearLayout.LayoutParams(-2, -2);
lpShareTo.gravity = 16;
lpShareTo.setMargins(dp_9, 0, 0, 0);
tvShareTo.setLayoutParams(lpShareTo);
llToolBar.addView(tvShareTo);
HorizontalScrollView sv = new HorizontalScrollView(getContext());
sv.setHorizontalScrollBarEnabled(false);
sv.setHorizontalFadingEdgeEnabled(false);
LinearLayout.LayoutParams lpSv = new LinearLayout.LayoutParams(-2, -2);
lpSv.setMargins(dp_9, dp_9, dp_9, dp_9);
sv.setLayoutParams(lpSv);
llToolBar.addView(sv);
this.llPlat = new LinearLayout(getContext());
this.llPlat.setLayoutParams(new FrameLayout.LayoutParams(-2, -1));
sv.addView(this.llPlat);
return llToolBar;
}
示例6: getPlatformList
import android.widget.HorizontalScrollView; //导入方法依赖的package包/类
private LinearLayout getPlatformList() {
LinearLayout llToolBar = new LinearLayout(getContext());
LayoutParams lpTb = new LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
llToolBar.setLayoutParams(lpTb);
TextView tvShareTo = new TextView(getContext());
int resId = getStringRes(activity, "ssdk_oks_share_to");
if (resId > 0) {
tvShareTo.setText(resId);
}
tvShareTo.setTextColor(0xffcfcfcf);
tvShareTo.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
int dp_9 = dipToPx(getContext(), 9);
LayoutParams lpShareTo = new LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lpShareTo.gravity = Gravity.CENTER_VERTICAL;
lpShareTo.setMargins(dp_9, 0, 0, 0);
tvShareTo.setLayoutParams(lpShareTo);
llToolBar.addView(tvShareTo);
HorizontalScrollView sv = new HorizontalScrollView(getContext());
sv.setHorizontalScrollBarEnabled(false);
sv.setHorizontalFadingEdgeEnabled(false);
LayoutParams lpSv = new LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lpSv.setMargins(dp_9, dp_9, dp_9, dp_9);
sv.setLayoutParams(lpSv);
llToolBar.addView(sv);
llPlat = new LinearLayout(getContext());
llPlat.setLayoutParams(new HorizontalScrollView.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
sv.addView(llPlat);
return llToolBar;
}
示例7: 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;
}
示例8: AbSlidingTabView
import android.widget.HorizontalScrollView; //导入方法依赖的package包/类
public AbSlidingTabView(Context context, AttributeSet attrs) {
super(context, attrs);
this.context = context;
this.setOrientation(LinearLayout.VERTICAL);
this.setBackgroundColor(Color.rgb(255, 255, 255));
mTabScrollView = new HorizontalScrollView(context);
mTabScrollView.setHorizontalScrollBarEnabled(false);
mTabScrollView.setSmoothScrollingEnabled(true);
mTabLayout = new LinearLayout(context);
mTabLayout.setOrientation(LinearLayout.HORIZONTAL);
mTabLayout.setGravity(Gravity.CENTER);
// mTabLayout是内容宽度
mTabScrollView.addView(mTabLayout, new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.FILL_PARENT));
this.addView(mTabScrollView, new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
// 内容的View的适配
mViewPager = new ViewPager(context);
// 手动创建的ViewPager,必须调用setId()方法设置一个id
mViewPager.setId(1985);
pagerItemList = new Vector<Fragment>();
// 定义Tab栏
tabItemList = new Vector<TextView>();
tabItemTextList = new Vector<String>();
tabItemDrawableList = new Vector<Drawable>();
// 要求必须是FragmentActivity的实例
if (!(this.context instanceof FragmentActivity)) {
Log4jLog.e(LONG_TAG, "构造AbSlidingTabView的参数context,必须是FragmentActivity的实例。");
}
FragmentManager mFragmentManager = ((FragmentActivity) this.context)
.getSupportFragmentManager();
mFragmentPagerAdapter = new AbFragmentPagerAdapter(mFragmentManager,
pagerItemList);
mViewPager.setAdapter(mFragmentPagerAdapter);
mViewPager.setOnPageChangeListener(new MyOnPageChangeListener());
mViewPager.setOffscreenPageLimit(3);
this.addView(mViewPager, new LinearLayout.LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
}