當前位置: 首頁>>代碼示例>>Java>>正文


Java HorizontalScrollView.setHorizontalScrollBarEnabled方法代碼示例

本文整理匯總了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);
}
 
開發者ID:wanliyang1990,項目名稱:NavigationBar,代碼行數:18,代碼來源:NavitationScrollLayout.java

示例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);
}
 
開發者ID:active-citizen,項目名稱:android.java,代碼行數:18,代碼來源:ExpertsView.java

示例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;
}
 
開發者ID:liupengandroid,項目名稱:ywApplication,代碼行數:38,代碼來源:EditPage.java

示例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;
}
 
開發者ID:SShineTeam,項目名稱:Huochexing12306,代碼行數:38,代碼來源:EditPage.java

示例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;
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:29,代碼來源:EditPage.java

示例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;
}
 
開發者ID:zzlnewair,項目名稱:Myshop,代碼行數:38,代碼來源:EditPage.java

示例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;
}
 
開發者ID:MobClub,項目名稱:BBSSDK-for-Android,代碼行數:45,代碼來源:ForumThreadView.java

示例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));

}
 
開發者ID:entboost,項目名稱:EntboostIM,代碼行數:52,代碼來源:AbSlidingTabView.java


注:本文中的android.widget.HorizontalScrollView.setHorizontalScrollBarEnabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。