From following .xml file I set xml to show TabHost but after i run it on emulator it show both both orientation. i want to set it to show only one orientation. How do i do? THanks you.
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<FrameLayout android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_above="@android:id/tabs" />
<TabWidget android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" />
</RelativeLayout>
</TabHost>
To adjust the screen rotation settings: Swipe down from the top of the screen to open the Quick settings panel. Look for the screen orientation icon. Depending on your settings, you may need to look for the Portrait, Landscape, or Auto Rotate icon.
If you want to disable Landscape mode for your Android app (or a single activity) all you need to do is add: android:screenOrientation="portrait" to the activity tag in AndroidManifest.
On android phones, the orientation typically defaults to portrait. When you disable auto-rotation, the screen will always remain in a portrait mode. On android tablets, the orientation typically defaults to landscape. When you disable auto-rotation, the screen will always remain in a landscape mode.
add this line in your manifest.xml file.
<activity android:name=".activity"
android:screenOrientation="portrait">
</activity>
if you want only landscape orientation then change to landscape
instead of portrait
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With