2011-09-15 7 views
3

이미지 레이아웃과 비슷한 모양을 만들기 위해 상대 레이아웃을 사용하고 있습니다. 그러나 일부 휴대폰에서는 (이미지 2 참조) 하단 버튼이 잘 리기 때문에 전체 레이아웃을 볼 수 없습니다. 휴대 전화에 따라 상대 레이아웃을 조정하는 것이 목적이 아닌가?안드로이드 관련 레이아웃 문제

이 문제를 해결하려면 어떻게해야합니까? 간단한 방법이 없다면 버튼을 볼 수 있도록 아래로 스크롤해야합니까?

감사 enter image description here

enter image description here

여기에 두 가지 방법 ............

1)이 있습니다 내 XML 레이아웃

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" android:layout_width="fill_parent" 
    android:background="@drawable/settings" android:layout_height="fill_parent" 
    android:weightSum="1"> 
    <RelativeLayout android:layout_width="fill_parent" android:layout_height="45dp" android:background="@drawable/mytitlebackground"> 
     <Button android:layout_height="wrap_content" android:id="@+id/btnDeleteAccount" android:layout_width="wrap_content" android:text="@string/deleteaccount" android:layout_alignParentTop="true" android:layout_alignParentLeft="true"></Button> 
     <Button android:layout_height="wrap_content" android:id="@+id/btnhistory" android:layout_width="wrap_content" android:text="@string/history" android:layout_alignParentTop="true" android:layout_alignParentRight="true"></Button> 
    </RelativeLayout> 
    <RelativeLayout android:id="@+id/relativeLayout1" android:layout_width="262dp" android:layout_height="80dp" android:background="#333333" android:layout_below="@+id/textView1" android:layout_centerHorizontal="true" android:layout_marginTop="17dp"> 
     <TextView android:textStyle="bold" android:textColor="#ffffff" android:textSize="13sp" android:layout_marginTop="14dp" android:layout_marginLeft="14dp" android:text="@string/Name" android:layout_alignParentLeft="true" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_alignParentTop="true" android:id="@+id/textView2"></TextView> 
     <TextView android:textStyle="bold" android:textSize="13sp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffffff" android:id="@+id/textView3" android:text="@string/BackgroundUpdates" android:layout_below="@+id/textView2" android:layout_alignLeft="@+id/textView2" android:layout_marginTop="16dp"></TextView> 
     <ToggleButton android:layout_width="wrap_content" android:id="@+id/toggleButtonBGUpdates" android:layout_height="wrap_content" android:layout_below="@+id/tVName" android:layout_toRightOf="@+id/textView3" android:layout_marginLeft="28dp"></ToggleButton> 
     <TextView android:textSize="13sp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffffff" android:id="@+id/tVName" android:text="name" android:layout_alignTop="@+id/textView2" android:layout_toRightOf="@+id/textView2" android:layout_marginLeft="19dp"></TextView> 
    </RelativeLayout> 
    <TextView android:text="@string/GPSInformation" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:id="@+id/textView4" android:layout_below="@+id/relativeLayout1" android:layout_centerHorizontal="true" android:layout_marginTop="16dp"></TextView> 
    <RelativeLayout android:id="@+id/relativeLayout2" android:layout_width="262dp" android:layout_height="130dp" android:background="#333333" android:layout_below="@+id/textView4" android:layout_alignLeft="@+id/relativeLayout1"> 
     <ImageView android:layout_marginLeft="18dp" android:layout_alignParentBottom="true" android:layout_width="wrap_content" android:layout_alignParentLeft="true" android:id="@+id/imageView1" android:layout_height="wrap_content" android:src="@drawable/fullbattery" android:layout_marginBottom="14dp"></ImageView> 
     <ImageView android:layout_alignTop="@+id/imageView1" android:layout_alignParentRight="true" android:layout_width="wrap_content" android:layout_marginRight="18dp" android:id="@+id/imageView2" android:layout_height="wrap_content" android:src="@drawable/halfbattery"></ImageView> 
     <RadioGroup android:layout_width="wrap_content" android:layout_alignParentTop="true" android:id="@+id/rGTimer" android:orientation="horizontal" android:layout_alignParentLeft="true" android:layout_height="wrap_content"> 
      <RadioButton android:layout_height="wrap_content" android:id="@+id/r30mins" android:text="@string/updateevery30mins" android:textSize="13sp" android:layout_width="130dp" android:checked="true"></RadioButton> 
      <RadioButton android:layout_height="wrap_content" 
    android:id="@+id/r10mins" android:text="@string/updateevery10mins" 
    android:textSize="13sp" android:layout_width="130dp"></RadioButton> 
     </RadioGroup> 
    </RelativeLayout> 
    <Button android:layout_height="wrap_content" android:id="@+id/btnRenableHelpScreen" android:layout_width="wrap_content" android:text="@string/Turnonhelpscreens" android:layout_below="@+id/relativeLayout2" android:layout_alignRight="@+id/textView4" android:layout_marginTop="14dp"></Button> 
    <TextView android:text="@string/AccountInformation" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:id="@+id/textView1" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginTop="55dp"></TextView> 

</RelativeLayout> 
+0

룩업 탭 위젯 – Sean

+0

버튼과 주위의 모든 것들에 weight = 1을 사용해보십시오. 그것을 고쳐야한다. – Urban

답변

1

입니다. 당신은 안드로이드에 레이아웃에 따라 이미지를 만들어야합니다. 적절하게 당신의 도움말 화면 버튼이 적절하게 표시되고 문제가 해결되지만 때때로 블러의 문제를 야기합니다. 이미지 및 또한 구성 요소 사이의 공간을 줄여야합니다 .......... 그리고 이것은 많은 응용 프로그램에서 이런 식으로 사용하는 가장 좋은 방법입니다

2). 첫 번째 레이아웃 시작에서 스크롤바를 추가하십시오. ...........

0

디스플레이 탭에서 전화 설정에서 글꼴 크기를 확인하시기 바랍니다 가 조정 된 경우에, 당신은 설정 DP 대신 SP을 사용해야합니다 텍스트보기의 텍스트 크기

이것은 작동 중입니다. n 내 문제는 너도 잘해야한다.

관련 문제