[英]How can I see the full layout in Android?
I have a LinearLayout
in Android
that has this structure: 我在Android
中有一个具有以下结构的LinearLayout
:
<LinearLayout>
<LinearLayout>
<EditText></EditText>
<TextView></TextView>
</LinearLayout>
//Here more LinearLayout similar to the LinearLayout that I put above
</LinearLayout>
But I have so much EditText
and LinearLayout
in my layout that I can't see the full layout in the screen of my mobile phone. 但是我的布局中有太多EditText
和LinearLayout
,以致于无法在手机屏幕上看到完整的布局。 It won't be a problem if I could move the screen to see the full layout, but I couldn't. 如果我可以移动屏幕来查看完整的布局,这不会有问题,但是我不能。 I just can see the elements that enter in the screen, the rest aren't accesible. 我只能在屏幕上看到输入的元素,其余的都是不可访问的。
I saw a lot of questions but any of them let me fix my error. 我看到了很多问题,但是其中任何一个都可以让我解决错误。
What can I do? 我能做什么?
Thanks in advance! 提前致谢!
Choose a ScrollView as container for your layout 选择一个ScrollView作为布局的容器
Like this: 像这样:
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout>
<LinearLayout>
<EditText></EditText>
<TextView></TextView>
</LinearLayout>
//Here more LinearLayout similar to the LinearLayout that I put above
</LinearLayout>
This is the referece about ScrollView 这是有关ScrollView的参考
Use ScrollView
as root 使用ScrollView
作为root
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout>
<LinearLayout>
<EditText></EditText>
<TextView></TextView>
</LinearLayout>
//Here more LinearLayout similar to the LinearLayout that I put above
</LinearLayout>
</ScrollView>
Try packaging your most outer LinearLayout
with a ScrollView
. 尝试使用ScrollView
包装最外面的LinearLayout
。 This will allow your users to scroll down and see all the content. 这将使您的用户向下滚动并查看所有内容。
ScrollView
example ScrollView
示例
Good luck! 祝好运!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.