2013-08-19 2 views
2

나는 안드로이드에서 첫 번째 앱을 개발 중이며 내 애플리케이션이 여러 화면을 지원하는 데 필요한 요구 사항 (dp 또는 sp 등 사용)을 충족한다고 생각합니다.잘못된 xml 또는 Android 호환성 문제가 있습니까?

그러나 내가 잘못한 것 같습니다. 텍스트 뷰는 화면 하단에서 겹쳐집니다.

지금은 ... 나쁜 XML을 작성 했습니까? 아니면 이런 종류의 문제를 피하기 위해 각 Android 버전에 다른 레이아웃을 추가해야합니까?

먼저 장치 사양 (도코모 ARROWS NX F-06E) 우선 단말기 화면 1080 × 1920 픽셀, 16,777,216 :

http://s15.postimg.org/r8tp0oay3/Screenshot_2013_08_19_22_08_33.png

제 2 소자 사양 (LG L-07C 옵티) 480 X 800 픽셀 , 256K 색상 보조 장치 스크린 샷 : http://s22.postimg.org/xkqbne74h/i001.jpg

다음은 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> 

+1

여기 –

+0

감소 텍스트 크기를 스크린 샷을 첨부하거나 사용중인 드로어 블에 대한 정보를 제공하시기 바랍니다 수있는 화면의 크기 – Sw4Tish

+0

에 따라 여러 XML 레이아웃 구성을 만들 수 있습니다 경우, 당신을 돕기 위해 쉬울 것? 너는 usinn 9patch 이미지 있니? –

답변

1

그것은 종횡비 간단한 문제이다 : 따라서 고해상도 화면 3

9

  • 480X800 5 :

    • 1080x1920 16 인 더 긴 (더 큰) 직사각형. 레이아웃은 레이아웃의 일부가 바닥에 걸리고 다른 부분이 상단에 매달 리도록 설계되어 있지만 키가 큰 화면을 염두에두고 디자인 했으므로 작은 화면에서 함께 실행됩니다.

      1. 는 키가 화면에 어떤 경우에는 그냥 상단과 하단 부분 사이에 많은 여분의 공간을 보여 늘릴 것, 짧은 화면에 제대로 맞게 레이아웃을 재 설계 : 당신은 두 가지 옵션 중 하나 있습니다.
      2. 자원 한정자를 사용하여 화면의 높이에 따라 두 가지 레이아웃을 작성하십시오. 이 수준의 노력은 장치의 화면면에 관계없이 더 완벽한 픽셀을 구현하려고 할 때만 의미가 있습니다.
  • +0

    글꼴을 재구성하려고합니다! 그런 다음 리소스 한정자를 찾아서 다시 이러한 일이 발생하지 않도록하십시오. 고맙습니다. – pinolo