android - 为多个屏幕android创建我的 View

标签 android xml screen

我在不同屏幕尺寸上显示我的 View 时遇到问题。 enter image description here

我的附加 View 在 3.2 英寸屏幕上不完全可见,但在 3.7 英寸屏幕上可以。我已经在图像本身中描述了 sml 内容。请提出解决方案。

通常情况下,多屏幕的理想处理方式是什么? android 是否针对不同的屏幕尺寸自动调整它?

最佳答案

让你的 linearLayout 高度 fillparent :

android:layout_height="fill_parent"

当然,您的 ScrollView 必须具有相对高度。

但是……

接下来我会这样做:

RelativeLayout
-scrollview
-LinearLayout (with button)

然后首先在您的 xml 中放入您的 linearLayout,宽度固定高度,然后在 scrollView 中制作 android:layout_below="@+id/LinearLayoutId"。在那之后把 android:layout_height="fill_parent" 在 scrollView 中,最后放置 LinearLayout android:layout_alignParentBottom="true"

关于android - 为多个屏幕android创建我的 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7778082/

相关文章:

android - 如何将膨胀的自定义 View 与工具栏中的其余菜单项对齐

ios - 如何将xml解析成表格 View

xml - Grails - 测试 XML 请求未按预期运行

android - gradle junit测试报告不是xml格式

Android、IOS强制压屏

android - 将 Koltin Flow 与 LiveData 一起使用时未调用 onCompletion

android - 两个 fragment 之间的通信(android)

android - 使用 PdfDocument 将 HTML 转为 PDF

Android - Unity3D 在某些手机上的启动画面中卡住

linux - Redshift 打开和关闭(闪烁)