ユーザ用ツール

サイト用ツール


サイドバー

android:回転固定

回転固定

androidManifest.xml内の対象となるactivityタグの中にscreenOrientationを設定する。

縦固定

AndroidManifest.xml
<activity
    android:name=".MainActivity"
    android:screenOrientation="portrait" >
</activity>

横固定

AndroidManifest.xml
<activity
    android:name=".MainActivity"
    android:screenOrientation="landscape" >
</activity>

サンプル

AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.nekotype.ips.thechoice">
 
    <uses-permission android:name="android.permission.INTERNET" />
 
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MenuActivity"
            android:screenOrientation="portrait"> // ←ここ
            <intent-filter> 
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            ・・・
android/回転固定.txt · 最終更新: 2019/12/09 23:55 by ips