本文整理汇总了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);
}
示例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);
}
}
示例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));
}
}