I am placing my application in landscape mode in my manifest:
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
<activity
android:name=".VerticalSlideshow"
android:label="@string/title_activity_prime" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
I have a FrameLayout containing a vertical ScrollView in the background which is humming along fine and a LinearLayout with an ImageView some buttons in the foreground. Everything works fine except the foreground image/buttons will not go into landscape mode using the emulator. Here is my code:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ddffff" >
<ScrollView
android:id="@+id/horizontal_scrollview_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fadingEdge="none" >
<LinearLayout
android:id="@+id/horiztonal_outer_layout_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingBottom="0dp"
android:paddingTop="0dp" >
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/moving"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:background="@drawable/clear"
android:gravity="center_horizontal"
android:orientation="horizontal" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/truck1" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="right"
android:layout_weight="0.12"
android:gravity="right"
android:orientation="vertical" >
<ImageButton
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="@drawable/carfs"
android:src="@drawable/clear" />
<ImageButton
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="@drawable/policef"
android:src="@drawable/clear" />
<ImageButton
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="@drawable/taxif"
android:src="@drawable/clear" />
<ImageButton
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="@drawable/amulancef"
android:src="@drawable/clear" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
The XML preview in Eclipse looks fine. Should I test on a real phone? Ultimately, how can I force this linearview into landscape?
try to put android:screenOrientation=”landscape” in your activity tag instead of application tag in your manifest file