读书人

帮忙看下小弟我的tab布局有有关问题

发布时间: 2013-07-16 22:38:05 作者: rapoo

帮忙看下我的tab布局有问题,谢谢了
帮忙看下小弟我的tab布局有有关问题,多谢了

我已经用代码设置全屏了,但是还会有白边,而且网上提供的设置tabs文字居中也不管用 ,我是android 2.1.
谢谢大家了
下面是我的布局代码,求真正管用设置TabWidget文字居中的代码,或者自定义的


android:layout_height="fill_parent"
>
</ListView>
</LinearLayout>


<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:id="@+tab/s2"

>

<ListView
android:id="@+tab/lv2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
</ListView>
</LinearLayout>


<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:id="@+tab/s3"

>

<ListView
android:id="@+tab/lv3"
android:layout_width="fill_parent"


android:layout_height="fill_parent"
>
</ListView>
</LinearLayout>

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:id="@+tab/s4"

>

<ListView
android:id="@+tab/lv4"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
</ListView>
</LinearLayout>


<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:id="@+tab/s5"

>

<ListView
android:id="@+tab/lv5"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
</ListView>


</LinearLayout>


<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:id="@+tab/s6"

>

<ListView
android:id="@+tab/lv6"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
</ListView>
</LinearLayout>
</FrameLayout>

<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:layout_marginBottom="-5dp"/>

</LinearLayout>

</TabHost>


[解决办法]
上面已经提出了文字居中了 我说下白边吧

把你主要的view(即你的listview所在的layout)设置layout_weight = 1;

读书人网 >Android

热点推荐