TabActivity布局的页签高度设置问题

MIS_ECSM 2010-04-07 03:47:40
TabActivity布局的页签高度如何设置,如下图中tab1,tab2,tab3页签的高度
...全文
683 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
yangxuanlun 2010-05-01
  • 打赏
  • 举报
回复
为什么要设置高度呢,我认为美化可以加点图片就行。而且最主要的是,我在真机上调试的时候发现他那个选项卡不是很高,也就是说没有模拟器上那么丑。你非要设置高度的话,据说可以通过什么方法隐藏一部分,可能是调一下它与TOP的距离吧。我以前也做过这个,不过不记得了。嘿嘿...
vclongking 2010-04-08
  • 打赏
  • 举报
回复
每具体设置过它的高度 关注 学习
ffyd2000 2010-04-07
  • 打赏
  • 举报
回复
记得是这样的:
按照android源码里面的tab_content.xml写一个layout,修改TabWidget的高度
在你的TabActivity的oncreate方法里面setContentView(R.layout.xxxxx)
ok
tab_content.xml内容:
<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">
<TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_weight="0" />
<FrameLayout android:id="@android:id/tabcontent"
android:layout_width="fill_parent" android:layout_height="0dip"
android:layout_weight="1"/>
</LinearLayout>
</TabHost>
lingyu2843 2010-04-07
  • 打赏
  • 举报
回复
看不到,一般都是写好XML文件,然后通过LayoutInflater填充

80,350

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧