2
我在写一个实现嵌套选项卡的应用程序。由于两组选项卡占用相当多的空间,并且通常因为内容的性质,我想将整个内部TabHost放入可滚动结构中。我可以使外部活动FrameLayout,LinearLayout,甚至ViewFlipper的tabcontent;当我尝试使它成为ScrollView时,程序崩溃。Android - TabHost里面滚动查看
<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" />
<ScrollView
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
</TabHost>
显然,TabHost喜欢住在不可滚动的框架内。有没有什么办法可以解决这个问题而不会造成一大堆混乱?