横向模式和LinearLayout / ScrollView

时间:2014-07-17 16:35:00

标签: android scrollview landscape

我试图让我的Android应用程序在横向模式下工作,但到目前为止我都失败了。下面是布局的xml代码,我想知道如何在横向模式下使用ScrollView

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        xmlns:android1="http://schemas.android.com/apk/res/android"
        android1:id="@+id/LinearLayout1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#FFDEAD"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        android1:gravity="center|left|right"
        android1:orientation="vertical"
        tools:context=".MainActivity" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Number1" ></TextView>

        <EditText
            android:id="@+id/N1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="Enter number 1"
            android:inputType="numberSigned" >

            <requestFocus />
        </EditText>

</LinearLayout>

1 个答案:

答案 0 :(得分:1)

你的LinearLayout附近有没有这样的东西?

<ScrollView  xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent">

    <LinearLayout>
        ...
    </LinearLayout> 

</ScrollView>
相关问题