0

私の国でトップ 10 のハンドセットとタブレットについて事前に調査した結果、次のように分類できます。

HANDSETS:
533dp x 320dp
640dp x 360dp
853dp x 480dp  

TABLETS:
1280dp x 800dp
960dp x 600dp  

したがって、API レベル 11 以降をサポートしていることを考えると、レイアウトを指定する古い方法と新しい方法の両方を含める必要があります。したがって、私のレイアウトは古いバージョンでは次のようになります。

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
<< and the corresponding landscape >>   

新しいものは次のsw<N>dpようになります (ハンドセットの場合):

res/layout-sw320dp/my_layout.xml
res/layout-sw360dp/my_layout.xml
res/layout-sw480dp/my_layout.xml
<< and the landscape >>
res/layout-sw320dp-land/my_layout.xml
res/layout-sw360dp-land/my_layout.xml
res/layout-sw480dp-land/my_layout.xml  

それで、ここに質問があります:

  1. 新しい修飾子を含むレイアウトを適切に追加しましたか?
  2. 公式ドキュメント426dp x 320dp470dp x 320dpは、例として適切な画面サイズが記載されています。私はかなり奇妙なを持ってい533dp x 320dpます。DP サイズの計算でエラーが発生しましたか?
  3. 修飾子のないデフォルトのレイアウトは必要ありませんか、それともやり過ぎですか?
4

0 に答える 0