我有一个带3个选项卡的操作栏。 它看起来像这样: |全部|电话|网络| 我希望它们具有相同的宽度。我该怎么做?ActionBar选项卡的重量/宽度
0
A
回答
2
可以使用在动作条setCustomView()方法的标签设置为任何看法。标签。这是我做到的。自定义视图是从一个布局加载的,在我的情况下,它与ActionBar.Tag使用的内置布局类似,您可以根据需要设置边距,大小和内容。
0
他们所有的行对准相同的宽度
<?xml version="1.0" encoding="utf-8"?>
<TabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<HorizontalScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:scrollbars="none">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</HorizontalScrollView>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
</TabHost>
然后设置选项卡主机
TabHost tabHost;
TabHost.TabSpec spec;
tabHost=getTabHost()
Intent intent;
intent=new Intent().setClass(this, BirthDayTab.class);
spec=tabHost.newTabSpec("artists").setIndicator("BirthDay",res.getDrawable(R.drawable.ic_tab_artists)).setContent(intent);
tabHost.addTab(spec);
+2
号你说的是常规选项卡中的精确解。我正在谈论** ActionBar Tabs ** – 2012-02-02 13:27:39
-1
相关问题
- 1. ActionBar选项卡高度
- 2. ActionBar Sherlock选项卡太短//如何设置选项卡的宽度
- 3. 获取不同宽度的ActionBar选项卡
- 4. 从一定宽度的Android更改ActionBar选项卡
- 5. ActionBar中的选项卡数量
- 6. wxPython wx.TextCtrl选项卡宽度
- 7. ActionBar选项卡“锁定”下面的ActionBar
- 8. ActionBar选项卡内容重叠
- 9. Android Actionbar选项卡导航
- 10. 选项卡 - tabView或ActionBar
- 11. Android片段选项卡 - 增加选项卡宽度onTabSelected
- 12. 操作栏选项卡选项卡宽度不固定
- 13. 在Android ActionBar选项卡的选项卡中添加FragmentActivity。
- 14. 选择ActionBar选项卡时打开新行选项卡
- 15. 调整宽度选项卡jquery
- 16. jquery UI选项卡宽度100%
- 17. JQuery UI选项卡宽度JSON响应
- 18. 更改VIM gui选项卡宽度
- 19. 如何更改tortoisehg选项卡宽度
- 20. ActionBar标签宽度
- 21. 可变宽度选项卡(自动宽度)
- 22. 更改IDLE选项卡宽度/缩进宽度Python
- 23. 带有FragmentActivity的ActionBar选项卡
- 24. ActionBar中的导航选项卡
- 25. 片段中的ActionBar选项卡
- 26. 更改ActionBar选项卡上的字体
- 27. ActionBar Sherlock的样式选项卡
- 28. FragmentTransaction .attach和.detach的Actionbar选项卡
- 29. Honeycomb的Android ActionBar选项卡样式
- 30. Xamarin Android ActionBar选项卡 - 1选项卡不显示文本
我会试试看。谢谢。 – 2012-02-02 16:05:20
有用吗,乌列尔先生? – habitats 2014-06-30 20:13:27