タブレット用とモバイル デバイス用のデモ アプリを作成しています。
これで、 2 つのアクティビティが 1 つになりました。tabs
そのため、タブ内に がありますListView
。
私の質問はListView
、左と右からいくらかのマージンでそれを示したいということです。したがって、向きが変わると、そのマージン値も変化します。それに従って、開発者側
からドキュメントを読みました。以下はリストビューのコードスニップです。フォルダ
内res/layout-xlarge-land
<ListView
android:id="@+id/android:list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="250dp"
android:layout_marginRight="250dp" >
</ListView>
res/layout-xlarge-port
フォルダ
内
<ListView
android:id="@+id/android:list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="100dp"
android:layout_marginRight="100dp" >
</ListView>
今の問題は、タブレットの向きを変更すると、縦向きモードのxmlファイルのみが使用され、横向きのxmlファイルは使用されないことです。では、この問題を解決する方法。
マニフェスト ファイルにも含まれて<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<supports-screens android:anyDensity="true" android:resizeable="true"/>
おり、アクティビティが含まれていますandroid:configChanges="orientation|screenSize"