我已经在调试器中针对许多不同大小测试了我的应用程序,并意识到我可能需要一个 scrollView 来允许用户查看完整的布局。
问题是我在 main.xml 中使用了具有多个线性布局的鳍状肢,如下所示:
<?xml version="1.0" encoding="utf-8"?>
<ViewFlipper
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/your_flipper"
android:screenOrientation="portrait"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<!-- the second view on the flipper -->
<!-- ImageView -->
<!-- TextViews -->
<!-- Buttons -->
<!-- Image Buttons -->
</LinearLayout>
<!-- the 3rd view on the flipper -->
<!-- ImageView -->
<!-- TextViews -->
<!-- Buttons -->
<!-- Image Buttons -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
</LinearLayout>
<!-- the 4th view on the flipper -->
<!-- ImageView -->
<!-- TextViews -->
<!-- Buttons -->
<!-- Image Buttons -->
</LinearLayout>
我制作了 ImageViews、Buttons、TextViews 等注释,以免使代码臃肿 -
这是在我的主 xml 文件中,其中显示了所有布局。我怎样才能轻松地为每个布局添加一个滚动视图,所以如果它对于某个手机的屏幕来说太大了,用户可以滚动浏览页面以查看所有内容?
谢谢!