2013-02-25 56 views
1

我的設計採用的是Android 2.1罰款和罰款Android 4.0的正常分辨率的設備,但是當我跑我的平板電腦應用程序的設計完全改變了,幫我設計是不正確的高分辨率設備

<LinearLayout 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:orientation="vertical" 
android:background="@drawable/bowlbackground" > 

<LinearLayout 
    android:id="@+id/hkk" 
    android:layout_width="match_parent" 
    android:layout_height="54dp" 
    android:layout_marginLeft="18dp" 
    android:layout_marginRight="10dp" 
    android:layout_marginTop="05dp" > 

</LinearLayout> 
<LinearLayout 
    android:id="@+id/hll" 
    android:layout_width="match_parent" 
    android:layout_height="54dp" 
    android:layout_marginLeft="18dp" 
    android:layout_marginRight="10dp" 
    android:layout_marginTop="143dp" > 

</LinearLayout> 

<LinearLayout 
    android:id="@+id/hll2" 
    android:layout_width="match_parent" 
    android:layout_height="54dp" 
    android:layout_marginLeft="18dp" 
    android:layout_marginRight="10dp" 
    android:layout_marginTop="0dp" > 

     </LinearLayout> 

</LinearLayout> 

回答

1

使用本

res/layout/my_layout.xml    // layout for normal screen size ("default") 
res/layout-small/my_layout.xml  // layout for small screen size 
res/layout-large/my_layout.xml  // layout for large screen size 
res/layout-xlarge/my_layout.xml  // layout for extra large screen size 
res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation 

res/drawable-mdpi/my_icon.png  // bitmap for medium density 
res/drawable-hdpi/my_icon.png  // bitmap for high density 
res/drawable-xhdpi/my_icon.png  // bitmap for extra high density 
2
  1. 手機和平板電腦的設計有所不同。
  2. 避免使用固定的寬度和高度尺寸的意見(除非它真的 不可避免的)。 See this欲瞭解更多信息
  3. 請參閱文檔supporting multiple screens。它有助於設計平板電腦。
+1

只是添加到,請確保您使用[片段](http://developer.android.com/guide/components/fragments.html),這樣就可以更好使用從大屏幕獲得的額外房地產。 – ebarrenechea 2013-02-25 05:53:44

+0

嗨@RKN我已經使用你給定的鏈接,現在我正在使用layout-xlarge和layout-xlarge-land,現在我只需將餘量設置爲左上角的所有內容,但同樣不會像我定義的那樣 – kamal 2013-02-25 06:43:04

相關問題