2014-10-07 3 views
0

Благодарим вас всех.Общее масштабирование Android для разных устройств

У меня вопрос о масштабировании моего приложения, которое я недавно начал строить. Я довольно новичок в программировании, но еще больше новичок в разработке Android.

Как вы можете видеть: мои текстовые изображения отлично работают для меньшего разрешения, но не масштабируются для больших разрешений.

http://imgur.com/b5Ed3gh

Что бы возможное решение?

Моего код XML:

<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:background="@drawable/bg" 

    tools:context=".MyActivity"> 

    <TextView 
     android:id="@+id/topLeft" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true" 
     android:layout_marginLeft="20dp" 
     android:layout_marginTop="106dp" 
     android:width="135dp" 
     android:height="130dp" 
     android:background="@drawable/rounded_corner"/> 

    <Button 
     android:id="@+id/startButton" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true" 
     android:layout_centerHorizontal="true" 
     android:layout_marginTop="25dp" 
     android:background="@drawable/rounded_corner" 
     android:text="Start" /> 

    <TextView 
     android:id="@+id/counter" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignRight="@+id/topRight" 
     android:layout_alignTop="@+id/startButton" /> 

    <TextView 
     android:id="@+id/timer" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignLeft="@+id/topLeft" 
     android:layout_alignTop="@+id/startButton" /> 

    <TextView 
     android:id="@+id/bottomLeft" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignLeft="@+id/topLeft" 
     android:layout_below="@+id/topLeft" 
     android:layout_marginTop="10dp" 
     android:width="135dp" 
     android:height="130dp" 
     android:background="@drawable/rounded_corner" /> 

    <TextView 
     android:id="@+id/bottomRight" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignLeft="@+id/topRight" 
     android:layout_below="@+id/topRight" 
     android:layout_marginTop="10dp" 
     android:width="135dp" 
     android:height="130dp" 
     android:background="@drawable/rounded_corner" /> 

    <TextView 
     android:id="@+id/topRight" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignBaseline="@+id/topLeft" 
     android:layout_alignBottom="@+id/topLeft" 
     android:layout_alignParentRight="true" 
     android:layout_marginRight="20dp" 
     android:width="135dp" 
     android:height="130dp" 
     android:background="@drawable/rounded_corner" /> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:textAppearance="?android:attr/textAppearanceSmall" 
     android:id="@+id/highscore" 
     android:layout_toStartOf="@+id/counter" 
     android:layout_alignParentBottom="true" 
     android:layout_alignRight="@+id/startButton" 
     android:layout_alignEnd="@+id/startButton" 
     android:layout_marginBottom="41dp" /> 

</RelativeLayout> 

ответ

0

создать другую папку макета для устройства как

компоновщиков ИПЧРА

компоновщики MDPI

макета ldpi

макета-xdlpi и так один

Look This

Смежные вопросы