0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Android Studio アプリ画面の回転固定にする方法

Last updated at Posted at 2020-04-22

画面固定するために具体的にどこに記述したらいいのか
詳しく書いていない記事もあり多少手間取ったので、
健忘録として書いておきます。

アプリによっては画面固定にしておかないと
画面回転時にアプリ停止など予期せぬ動作をすることがあります。

縦画面固定にする場合

AndroidManifest.xml内の

acticity   と  >  の間に

android:screenOrientation="portrait"を挿入します。

 <activity android:name="com.catsw.catswitch.MainActivity"
                  android:screenOrientation="portrait">

↓のように記入する場所が違うと画面固定が反映されません。

<activity android:name="com.catsw.catswitch.MainActivity">

 android:screenOrientation="portrait"


横画面固定にする場合

AndroidManifest.xml内の

acticity   と  >  の間に

android:screenOrientation="landscape"を挿入します。

 <activity android:name="com.catsw.catswitch.MainActivity"
                  android:screenOrientation="landscape">

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?