2013-03-15 5 views
1

앱용으로 설계된 화면이 있습니다. 여기 화면 항목에 전체 항목을 표시 할 수 없습니다.

내가 내 응용 프로그램을 실행할 때, 나는 가로 모드에있는 모든 항목을 볼 수 있지만 세로 모드로 변환 할 때 내 테이블보기의 첫 번째 행을 볼 수 있습니다 내 XML

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@drawable/bghomescreen" > 

    <TableLayout 
     android:id="@+id/tlmaintable" 
     android:layout_width="match_parent" 
     android:layout_height="304dp" 
     android:layout_marginTop="100dp" 
     android:orientation="vertical"> 

     <TableRow 
      android:id="@+id/tableRow1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="60dp" > 

     <Button 
     android:id="@+id/btnsearchbylocation" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="10dp" 
     android:background="@drawable/btn_bg_location" /> 

     <Button 
     android:id="@+id/btnsearchbycuisine" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="10dp" 
     android:background="@drawable/btn_bg_cuisine1" /> 


     </TableRow> 

     <TableRow 
      android:id="@+id/tableRow2" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="80dp"> 

     <Button 
     android:id="@+id/btnquickbite" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="10dp" 
     android:background="@drawable/btn_bg_quickbite" /> 

     <Button 
     android:id="@+id/btnadvancesearch" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="10dp" 
     android:background="@drawable/btn_bg_cuisine"/>  
     </TableRow> 


    </TableLayout> 



</LinearLayout> 

입니다 . 나는 다른 사람들을 볼 수 없다.

치수가 480x800 인 화면을 사용하고 있습니다.

나를 도와주세요.

감사

+1

scrollview를 사용하십시오. – rajeshwaran

+0

@rajeshwaran thnx rajesh. 동일한 문서를 제공 할 수 있습니까? 너 한테 있으면. 고맙습니다 :). 하지만 rajesh 나는 다른 이미지를 볼 때 스크롤해야한다고 생각합니다. 한 번에 모든 이미지를 볼 수 있습니까? ... 할 수있는 방법이 있습니까? – Beginner

+1

@ user2143817 당신은 scrollview를 위해 doc을 필요로하지 않고 LinearLayout의 orienation을 설정하고 scrollview 아래에 선형 레이아웃을 유지합니다 – Pragnani

답변

0

가장 좋은 방법은 가로 방향으로 화면에 대한 별도의 레이아웃을 만드는 것입니다 .. 그 해결됩니다 당신을위한 문제 ..

0

추가보십시오 :

android:orientation="vertical" 

을있는 LinearLayout에 :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" 
android:background="@drawable/bghomescreen" > 
+0

당신은이 레이아웃에 단 하나의 아이템이 있다는 것을 알았습니까? – njzk2

0

가로 및 세로에 대한 별도 레이아웃 만들기 .
가로보기의 경우 layout-land 폴더에 xml을 입력하고 세로보기의 경우 동일한 이름을 가진 세로보기를 layout-port 폴더에 쓰십시오.
방향을 바꿀 때 레이아웃이 자동으로 호출됩니다.

+0

제안을위한 thnx,하지만 내가 레이아웃 - 토지를 추가하려고 할 때 약간의 오류가 나타납니다. – Beginner

0

나는 그 나는 또한 높이와 마진을 계산 작동하지 않는 이유는 잘 모릅니다 모든하지만이

처럼 행동 왜 나는 또한 궁금하지만 이클립스 코드를 시도하고 도움이된다면 하나 개의 대안이 시도 발견 너

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:gravity="center"> 

    <TableLayout 
     android:id="@+id/tlmaintable" 
     android:layout_width="match_parent" 
     android:layout_height="304dp" 
     android:orientation="vertical" > 

     <TableRow 
      android:id="@+id/tableRow1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="60dp" > 

      <Button 
       android:id="@+id/btnsearchbylocation" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="10dp" /> 

      <Button 
       android:id="@+id/btnsearchbycuisine" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="10dp" /> 
     </TableRow> 

     <TableRow 
      android:id="@+id/tableRow2" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="80dp" > 

      <Button 
       android:id="@+id/btnquickbite" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="10dp" /> 

      <Button 
       android:id="@+id/btnadvancesearch" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="10dp" /> 
     </TableRow> 
    </TableLayout> 

</RelativeLayout> 
관련 문제