【发布时间】:2011-10-08 13:45:44
【问题描述】:
我以前用过:
tabHost.getTabWidget().getChildAt(0).getLayoutParams().height =50;
设置我的标签高度。
但我想将此选项卡高度设置从 Java 代码移动到布局 xml 文件,目的是为 layout/main.xml 和 layout-large/main 使用不同的高度值.xml
我的问题是如何在 xml 文件中设置标签高度?
<?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">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</FrameLayout>
</LinearLayout>
</TabHost>
【问题讨论】:
标签: android android-layout android-emulator android-widget android-manifest