app:layout_behavior="@string/appbar_scrolling_view_behavior"
移到ScrollView中,我认为一切都应该正常工作。 <ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
your ImageView and TextViews here
</LinearLayout>
</ScrollView>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
>
我已经找到了解决方案。实际上,Android Studio 中存在一个 bug。在我的情况下,问题是当我从“属性”窗口启用 tabStripEnabled
时,组件树显示“无内容可显示”,而当我禁用它时,一切又恢复正常了。
因此,我通过编写程序代码来解决这个问题:
tabHost.getTabWidget().setStripEnabled(true);
所以我认为你应该逐一检查每个部分,以找到解决方案。希望这能有所帮助。
我遇到了这个问题,但是通过修改build.gradle文件中的配置来解决了这个问题: