LoginSignup
59
46

More than 5 years have passed since last update.

Android縦画面固定

Last updated at Posted at 2015-03-22

Androidで縦画面固定にする場合は、下記いずれかの方法で可能です。
 1)AndroidManifest.xmlで
 2)Activityで
ただし、いずれの場合も全画面において個別に設定する必要があります。

yotsuba_s.jpg 1)AndroidManifest.xmlで行う場合

Activityに下記の属性を追加

AndroidManifest.xml
<!-- activityに追記 -->
android:screenOrientation="portrait"

横画面は以下を指定
"landscape"

yotsuba_s.jpg 2)Activityで行う場合

xxxActivity.java
// onCreate()とかで
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

横画面は以下を指定
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE

(・o・ゞ いじょー。

59
46
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
59
46