如何在我的Android应用程序中以编程方式禁用自动旋转到纵向模式?
如何在此代码中禁用它?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/back"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.isummit1.MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="88dp"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="@string/hold_on_more_things_to_come_soon_"
android:textColor="#00FF00"
android:textSize="20sp"
android:textStyle="italic" />
答案 0 :(得分:0)
转到您的清单并将此行添加到您希望以特定方向强制的每个活动中纵向或横向
android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden|screenSize"