gpt4 book ai didi

android - 选项卡主机中的水平 ScrollView 不起作用或使我的内容消失

转载 作者:行者123 更新时间:2023-11-30 04:06:18 25 4
gpt4 key购买 nike

这是我的 main.xml,其中包含 tabhost:

问题是水平 ScrollView 不起作用。如果我将相对布局更改为线性布局选项卡是可滚动的,但我看不到我的 Activity 的主要内容 - 我只看到选项卡。

我也尝试过完全删除包含选项卡小部件的线性布局,但没有任何改变。

如果您需要任何其他 xml,请告诉我。

<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:paddingTop="@dimen/tab_space_top"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout android:id="@+id/tab_relative_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<HorizontalScrollView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:scrollbars="none">
<LinearLayout android:id="@+id/tab_linear_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TabWidget android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</TabWidget>
</LinearLayout>
</HorizontalScrollView>
<FrameLayout android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@android:id/tabs">

</FrameLayout>

</RelativeLayout>
</TabHost>

有什么帮助吗?

最佳答案

this sample 中列出的方法会解决您的问题。

关于android - 选项卡主机中的水平 ScrollView 不起作用或使我的内容消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11600771/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com