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


Java TabWidget.setDividerDrawable方法代碼示例

本文整理匯總了Java中android.widget.TabWidget.setDividerDrawable方法的典型用法代碼示例。如果您正苦於以下問題:Java TabWidget.setDividerDrawable方法的具體用法?Java TabWidget.setDividerDrawable怎麽用?Java TabWidget.setDividerDrawable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.TabWidget的用法示例。


在下文中一共展示了TabWidget.setDividerDrawable方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: prepare

import android.widget.TabWidget; //導入方法依賴的package包/類
@Override
protected void prepare() {
	TabItem Home = new TabItem(R.drawable.base_home, 
			new Intent(this, HomeActivity.class)); 

	TabItem Fclass = new TabItem(R.drawable.base_fclass_bg, new Intent(
			this, FclassHomeActivity.class));

	TabItem ShopCart = new TabItem(R.drawable.base_shopcart, new Intent(
			this, ShopCartActivity.class));

	TabItem MyCenter = new TabItem(R.drawable.base_mycenter, new Intent(
			this, MycenterHomeActivity.class));
	mItems = new ArrayList<TabItem>();
	mItems.add(Home);
	mItems.add(Fclass);
	mItems.add(ShopCart);
	mItems.add(MyCenter);

	@SuppressWarnings("deprecation")
	TabWidget tabWidget = getTabWidget();
	tabWidget.setDividerDrawable(R.drawable.tab_divider);

}
 
開發者ID:andongniao,項目名稱:AiStore,代碼行數:25,代碼來源:ExampleActivity.java

示例2: onAttachedToWindow

import android.widget.TabWidget; //導入方法依賴的package包/類
@Override
protected final void onAttachedToWindow() {
	super.onAttachedToWindow();
	mTabBar = (TabWidget) findViewById(android.R.id.tabs);
	// set custom divider work incorrect on version <= 3.0
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
		mTabBar.setDividerDrawable(R.color.divider);
	}
}
 
開發者ID:CactusSoft,項目名稱:zabbkit-android,代碼行數:10,代碼來源:ScrollableFragmentTabHost.java

示例3: initFragmentTabHost

import android.widget.TabWidget; //導入方法依賴的package包/類
private void initFragmentTabHost(Context context, AttributeSet attrs) {
    TypedArray a = context.obtainStyledAttributes(attrs,
            new int[] { android.R.attr.inflatedId }, 0, 0);
    mContainerId = a.getResourceId(0, 0);
    a.recycle();

    super.setOnTabChangedListener(this);

    // If owner hasn't made its own view hierarchy, then as a convenience
    // we will construct a standard one here.
    if (findViewById(android.R.id.tabs) == null) {
        LinearLayout ll = new LinearLayout(context);
        ll.setOrientation(LinearLayout.VERTICAL);
        addView(ll, new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.FILL_PARENT,
                ViewGroup.LayoutParams.FILL_PARENT));

        TabWidget tw = new TabWidget(context);
        tw.setId(android.R.id.tabs);
        tw.setOrientation(TabWidget.HORIZONTAL);
        tw.setDividerDrawable(null);//鍘繪帀浜嗗簳閮╰ab鍒嗗壊綰�
        ll.addView(tw, new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.FILL_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT, 0));

        FrameLayout fl = new FrameLayout(context);
        fl.setId(android.R.id.tabcontent);
        ll.addView(fl, new LinearLayout.LayoutParams(0, 0, 0));

        mRealTabContent = fl = new FrameLayout(context);
        mRealTabContent.setId(mContainerId);
        ll.addView(fl, new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.FILL_PARENT, 0, 1));
    }
}
 
開發者ID:leerduo,項目名稱:travelinfo,代碼行數:36,代碼來源:BaseFragmentTabHost.java


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