いつも大変お世話になっております。
ネット上の情報から縦画面、横画面にてLayoutを切り替えるにはlayout-landフォルダを作って横画面用に同じ名前のxmlファイルを入れ
ておけば、自動で切り替わると知りましたが、それだけではこちらの環境では横に傾けても縦のxmlが実行されます。
何か他に設定が必要なのでしょうか?xmlにも何か指定が必要でしょうか?
縦画面の場合は1ページを全画面で表示し、
横画面の場合は2ページを見開き表示させたいです。
またXperiaは画像のアスペクト比が全画面フルにすると合わないため余白のためダミーイメージを入れました。
■縦xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="
http://schemas.android.com/apk/res/
android"
android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/dummyImage01"
android:layout_height="52px" android:layout_width="wrap_content"></
ImageView>
<ImageView
android:id="@+id/ImageView01"
android:layout_width="480px"
android:layout_height="720px"
android:background="@drawable/p0"></ImageView>
<ImageView
android:id="@+id/dummyImage02"
android:layout_height="52px" android:layout_width="wrap_content"></
ImageView>
</LinearLayout>
■横xml(layout-landに入れたxmlファイル)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="
http://schemas.android.com/apk/res/
android"
android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/dummyImage01"
android:layout_width="92px"
android:layout_height="wrap_content"></ImageView>
<ImageView
android:id="@+id/ImageView01"
android:layout_width="320px"
android:layout_height="480px"
android:background="@drawable/p2"></ImageView>
<ImageView
android:id="@+id/ImageView02"
android:layout_width="320px"
android:layout_height="480px"
android:background="@drawable/p3"></ImageView>
<ImageView
android:id="@+id/dummyImage02"
android:layout_width="92px"
android:layout_height="wrap_content"></ImageView>
</LinearLayout>
初歩的な質問で申し訳ありませんがよろしくお願いします。
--
このメールは Google グループのグループ「Android-SDK-Japan」の登録者に送られています。
このグループに投稿するには、
android-...@googlegroups.com にメールを送信してください。
このグループから退会するには、
android-sdk-ja...@googlegroups.com にメールを送信してください。
詳細については、
http://groups.google.com/group/android-sdk-japan?hl=ja からこのグループにアクセスしてください。