滚动的Andr​​oid浏览/表大于屏幕尺寸屏幕尺寸、Andr、oid

2023-09-12 05:07:55 作者:伊人。未饮人先醉

我有看法/表格/活动,当在横向/水平方式显示出来,成为大于屏幕尺寸。我想知道什么是哪些用户可以向下滚动视图的方法是什么?

目前我所有的部件都在线性布局研究员。

 < LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    机器人:方向=垂直
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =FILL_PARENT
    机器人:isScrollContainer =真正的>

< WIDGET1>< / WIDGET1>
< Widget2>< / Widget2>
< Widget3>< / Widget3>
< Widget4>< / Widget4>
< Widget5>< / Widget5>
< / LinearLayout中>
 

解决方案

对于@Dimitris Makris在帮助我找到了正确的方向和写作的code,我首先感谢。不过,我已经找到了自己正确的解决办法是这样的。

 < XML版本=1.0编码=UTF-8&GT?;
<滚动型机器人:ID =@ + ID / scrollView1
机器人:layout_width =FILL_PARENT机器人:layout_height =FILL_PARENT
的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android>

<的LinearLayout
    机器人:方向=垂直
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =FILL_PARENT>

< WIDGET1 />
< Widget2 />

< / LinearLayout中>
< /滚动型>
 

I have view/form/activity, when displayed in landscape/horizontal mode, become bigger than screen size. I was wondering what is the way in which user can scroll down the view?

Currently all of my widgets are in the Linear layout as fellows.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:isScrollContainer="true">

<Widget1></Widget1>
<Widget2></Widget2>
<Widget3></Widget3>
<Widget4></Widget4>
<Widget5></Widget5>
</LinearLayout> 

解决方案

First thanks for the @Dimitris Makris in helping me out to find the right direction and writing the code for me. But the correct solution which I have found for myself is this.

<?xml version="1.0" encoding="utf-8"?>
<ScrollView android:id="@+id/scrollView1"
android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">

<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

<Widget1/>
<Widget2/>

</LinearLayout>
</ScrollView>