Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
46
Help us understand the problem. What is going on with this article?
@yasumodev

Android縦画面固定

More than 5 years have passed since last update.

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・ゞ いじょー。

46
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
yasumodev
「長い旅行に必要なのは大きなカバンじゃなく、口ずさめる一つの歌さ」スナフキン

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
46
Help us understand the problem. What is going on with this article?