画面の向きを指定する
2011年2月3日(木) 11:20 PM
アプリの画面の向きを指定するには、AndroidManifest.xmlに
縦向きの時、
<activity
android:screenOrientation=”portrait”>
横向きの時、
<activity
android:screenOrientation=”landscape”>
と書けばいいみたいです。
縦向き:
横向き:
< ?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.sample" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".Sample" android:label="@string/app_name" android:screenOrientation="portrait"> <intent -filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent> </activity> <activity android:name=".NextPage"> </activity> </application> </manifest>
その他のコードは、Intentを使って、Activityを呼び出す
と同じです。
Tag:
コメントの更新情報
トラックバックURL
https://appli-info.jp/2011/02/03/%e7%94%bb%e9%9d%a2%e3%81%ae%e5%90%91%e3%81%8d%e3%82%92%e6%8c%87%e5%ae%9a%e3%81%99%e3%82%8b/trackback/