【发布时间】:2021-09-15 21:12:26
【问题描述】:
我的布局不适合屏幕我该如何解决这个问题?谢谢您的帮助。我试图显示来自ViewModel 的数据。
这是我的 XML 代码
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/detailTopText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView" />
<ImageView
android:id="@+id/detailImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:src="@drawable/ic_launcher_background" />
<TextView
android:id="@+id/detailDesText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView2" />
</LinearLayout>
</ScrollView>
【问题讨论】:
-
问题不在于这种布局,而在于您如何设置操作栏和窗口。我们需要查看您的活动代码。
-
这是一个片段,里面没有关于动作栏的代码
标签: java android kotlin layout scrollview