2012-01-14 4 views
0

は、私は、そのmain.xmlファイルこのようなものですAndroidアプリ、作っています:レイアウトが散漫になっていますか?

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@drawable/background_full"> 

     <Button android:id="@+id/nxt_btn" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:gravity="center" 
      android:layout_marginLeft="170dp" 
      android:layout_marginTop="100dp" 
      android:background="@drawable/button_background"/> 

    <Button android:id="@+id/back_btn" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:gravity="center" 
      android:layout_marginLeft="360dp" 
      android:layout_marginTop="100dp" 
     android:background="@drawable/button_background"/> 

     <com.broov.player.DrawView 
      xmlns:android="http://schemas.android.com/apk/res/android" 
      android:id="@+id/drawingSurface" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
     android:layout_alignParentLeft="true" 
      android:layout_alignParentTop="true" 
      android:visibility="visible" /> 
</RelativeLayout> 
私のエミュレータで

それがうまく働いているのが、デバイスまたはエミュレーター解像度が変化したときにレイアウトが気を取られるようになりました。すべてのマシンに共通のレイアウトが必要です。

答えて

0

レイアウトのコンポーネントの関係をtoLeftOfまたはtoRightOfに指定する必要があります。

関連する問題