TAB布局宽度 [英] TAB Layout Width

查看:150
本文介绍了TAB布局宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我停留在我的xml code

I am stuck in my xml code

<TabWidget
                android:id="@android:id/tabs"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" />

我试图宽度更改为自定义设置浸数量,但

I am trying to change the width to a custom set dip number but

android:layout_width="50dip"

不作任何影响到标签宽度的布局 就这一个任何suggenstion吗?

is not making any affect to the tab width layout any suggenstion on this one please ?

下面是引擎收录完整的XML文件格式

Here is the full XML file Layout on pasteBin

http://pastebin.com/7vi4Pi8Z

谢谢 设拉子

推荐答案

没有体贡献了答案,但几个小时的奋斗后,我已经找到了办法 设置选项卡中的java code的宽... 在这里你去,如果有一个人可能需要稍后

No body contributed the answer but after few hours of struggle i have found the way to set the width of tabs in java code... here you go, if some one may need this later

TabWidget tabWidget = (TabWidget) findViewById(android.R.id.tabs);
final int tabChildrenCount = tabWidget.getChildCount();
for (int i=0; i< tabChildrenCount; i++)
{
        // change the value 110 to whatever suits you for tab width
    tHost.getTabWidget().getChildAt(i).getLayoutParams().width = 110;
}

非常感谢 设拉子

many thanks shiraz

这篇关于TAB布局宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆