나는 안드로이드에서 첫 번째 앱을 개발 중이며 내 애플리케이션이 여러 화면을 지원하는 데 필요한 요구 사항 (dp 또는 sp 등 사용)을 충족한다고 생각합니다.잘못된 xml 또는 Android 호환성 문제가 있습니까?
그러나 내가 잘못한 것 같습니다. 텍스트 뷰는 화면 하단에서 겹쳐집니다.
지금은 ... 나쁜 XML을 작성 했습니까? 아니면 이런 종류의 문제를 피하기 위해 각 Android 버전에 다른 레이아웃을 추가해야합니까?
먼저 장치 사양 (도코모 ARROWS NX F-06E) 우선 단말기 화면 1080 × 1920 픽셀, 16,777,216 :
제 2 소자 사양 (LG L-07C 옵티) 480 X 800 픽셀 , 256K 색상 보조 장치 스크린 샷 :
다음은 XML 코드입니다.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/myLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/dark_green"
android:orientation="vertical"
>
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="5dp"
android:src="@drawable/sakai" />
<TextView
android:id="@+id/random_field"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="false"
android:layout_alignParentRight="false"
android:layout_alignTop="@id/image"
android:layout_toLeftOf="@+id/chronometer"
android:layout_toRightOf="@id/image"
android:background="@drawable/bubble_bl"
android:text="@string/index"
android:textSize="20.5sp" />
<Chronometer android:id="@+id/chronometer"
android:format="@string/chronometer_initial_format"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="0dip"
android:layout_weight="0.5"
android:paddingBottom="30dip"
android:paddingTop="30dip"
/>
<Button
android:layout_below="@id/image"
android:id="@+id/askquestion"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/ask"
style="@style/ButtonText"
android:background="@drawable/btn_blue_states"
/>
<Button
android:layout_below="@id/askquestion"
android:id="@+id/answer1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/ask"
style="@style/ButtonText"
android:background="@drawable/btn_blue_states"/>
<Button
android:layout_below="@id/answer1"
android:id="@+id/answer2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/ask"
style="@style/ButtonText"
android:background="@drawable/btn_blue_states"/>
<Button
android:id="@+id/answer3"
android:layout_below="@id/answer2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/ask"
style="@style/ButtonText"
android:background="@drawable/btn_blue_states" />
<Button
android:id="@+id/answer4"
android:layout_below="@id/answer3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/ask"
style="@style/ButtonText"
android:background="@drawable/btn_blue_states"/>
<TextView
android:id="@+id/score_field"
android:layout_below="@id/answer4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:gravity="center"
android:text="@string/score"
android:textSize="24.5sp"
/>
<TextView
android:id="@+id/performance_field"
android:layout_below="@id/score_field"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="24.5sp"
/>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" android:layout_alignParentBottom="true"
android:weightSum="4.0" >
<TextView
android:id="@+id/difficult_textview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/difficulty"
android:textSize="24.5sp"
/>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/linearLayoutWithButtons"
android:orientation="horizontal"
android:weightSum="4.0" >
<Button
android:id="@+id/diff1"
style="@style/ButtonText"
android:layout_weight="1.0"
android:layout_height="wrap_content"
android:background="@drawable/btn_blue_states"
android:text="@string/one" />
<Button
android:id="@+id/diff2"
style="@style/ButtonText"
android:layout_weight="1.0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_blue_states"
android:text="@string/two" />
<Button
android:id="@+id/diff3"
style="@style/ButtonText"
android:layout_weight="1.0"
android:layout_height="wrap_content"
android:background="@drawable/btn_blue_states"
android:text="@string/three" />
<Button
android:id="@+id/diff4"
style="@style/ButtonText"
android:layout_weight="1.0"
android:layout_height="wrap_content"
android:background="@drawable/btn_blue_states"
android:text="@string/four" />
</LinearLayout>
</LinearLayout>
여기 –
감소 텍스트 크기를 스크린 샷을 첨부하거나 사용중인 드로어 블에 대한 정보를 제공하시기 바랍니다 수있는 화면의 크기 – Sw4Tish
에 따라 여러 XML 레이아웃 구성을 만들 수 있습니다 경우, 당신을 돕기 위해 쉬울 것? 너는 usinn 9patch 이미지 있니? –