2012-08-30 8 views
5

Androidには新しく、複数のレイアウトフォルダを使用してさまざまなサイズのデバイスに異なるレイアウトを指定する方法を学びます。エミュレータのAndroidタブレットが適切なレイアウトを選択していません

私はいくつかのことを試しましたが、エミュレートされたタブレットに大きなレイアウトを使用するために何も動作しないようです。

マイレイアウトディレクトリ構造は次のとおりです。

  • レイアウト
  • レイアウト-大
  • レイアウト-sw600dp
  • レイアウト-XLARGE

main.xml "レイアウト" にされます

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       android:orientation="vertical" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
     > 
    <SearchView android:id="@+id/searchView" 
       android:iconifiedByDefault="false" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content"/> 

    <FrameLayout 
      android:id="@+id/EarthquakeFragmentContainer" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      /> 
</LinearLayout> 

他の3つのフォルダ内main.xmlです:

  • ターゲット::のGoogle API(APIレベル16)
  • <?xml version="1.0" encoding="utf-8"?> 
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
           android:layout_width="fill_parent" 
           android:layout_height="fill_parent" 
           android:orientation="horizontal"> 
    
        <SearchView android:id="@+id/searchView" 
           android:iconifiedByDefault="false" 
           android:layout_width="wrap_content" 
           android:layout_height="wrap_content" 
           android:background="#FFF"/> 
    
        <fragment android:name="com.paad.earthquake.EarthquakeListFragment" 
           android:id="@+id/EarthquakeListFragment" 
           android:layout_width="360dp" 
           android:layout_height="fill_parent" 
          /> 
    
        <fragment android:name="com.paad.earthquake.EarthquakeMapFragment" 
           android:id="@+id/EarthquakeMapFragment" 
           android:layout_width="fill_parent" 
           android:layout_height="fill_parent" 
          /> 
    
    </LinearLayout> 
    

    エミュレータセットアップは、Googleのネクサス7をエミュレートしようとしています

  • 皮膚:WXGA800-7in
  • SDカード:私は肌が付属して、他のすべてのオプションを使用してい
  • 16M、プラスhw.keyboard = YESとhw.ramSize = 512

これはなぜ動作しないのですか?

ありがとうございました!それはあなたの供給というレイアウト-大から選択されますので、

+1

ネクサス7は、大tvdpiデバイスであります何がうまくいかないのですか? –

+1

"layout-large"ディレクトリや "layout-sw600dp"ディレクトリではなく、標準の "layout"ディレクトリのmain.xmlを使用しています。 – user1563784

+0

http://stackoverflow.com/ a/11735766/1012284 RUで抽象的なLCS密度を213dpiに設定することをお確かめください。 –

答えて

0

あなたは10" タブレットとAndroid 3.2以上を使用している場合、あなたはあなたのレイアウトファイルを持つようにレイアウトsw720dpフォルダを持っている必要があり

関連する問題