尝试使我的整个布局可滚动
我已经设计了布局,在较小的手机屏幕上并不是所有内容都可见,所以我想使其可滚动,有人可以帮助我解决这个问题吗?以下是我的布局的基本结构。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/allowanceroot"
android:background="@drawable/background"
>
--TextView--
--EditText--
--TextView--
--EditText--
--TextView--
--EditText--
</LinearLayout>
我是否只将 TextView 和 EditText 包含在 LinearLayout 中,然后将其包含在 ScrollView 中?还有什么我需要以编程方式做的事情吗?
I have designed my layout and on smaller phone screens not everything is visible, so I'd like to make it scrollable, could somebody help me with how to go about this? Below is the basic structure of my layout.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/allowanceroot"
android:background="@drawable/background"
>
--TextView--
--EditText--
--TextView--
--EditText--
--TextView--
--EditText--
</LinearLayout>
Do I just contain my TextViews and EditTexts in a LinearLayout, and then contain that in a ScrollView? Also is there anything I need to do programmatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试将其包装在滚动视图中
https://stackoverflow.com/a/4202608/661079
您不需要做任何其他事情做
Try wrapping it in a scrollview
https://stackoverflow.com/a/4202608/661079
There is nothing else you need to do
尝试这样
Try like this