2014-07-17 5 views
0

가로 모드에서 Android 앱을 작동 시키려고했지만 지금까지 실패했습니다. 아래는 레이아웃 용 XML 코드이며 가로 모드에서는 ScrollView을 사용하는 방법을 알고 싶습니다.가로 모드 및 LinearLayout/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> 
+0

scrollView는 어디에 있습니까? – Jack

+1

전체 레이아웃 주위에'ScrollView'를 넣지 않는 이유는 무엇입니까? 이 문제를 해결할뿐만 아니라 작은 화면에서도 레이아웃을 사용할 수 있습니다. 원하지 않으면 풍경을위한 추가 레이아웃을 만들어야합니다. 자세한 내용은 [** 여기 **] (http://developer.android.com/guide/practices/screens_support.html#qualifiers)를 참조하십시오. –

+0

@jack 앱을 가로 모드로 만든 후에 scrollview를 추가하고 싶습니다. –

답변

0

LinearLayout과 비슷한 것이 있습니까?

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

    <LinearLayout> 
     ... 
    </LinearLayout> 

</ScrollView>