「MonoGame (Xamarin.Android)で画面の向きを指定する」を編集中
ナビゲーションに移動
検索に移動
この編集を取り消せます。 下記の差分を確認して、本当に取り消していいか検証してください。よろしければ変更を保存して取り消しを完了してください。
最新版 | 編集中の文章 | ||
4行目: | 4行目: | ||
このActivityクラスの「ScreenOrientation属性」を変更する。 | このActivityクラスの「ScreenOrientation属性」を変更する。 | ||
基本的には至って普通のXamarin.Androidでの方法と同じである。 | 基本的には至って普通のXamarin.Androidでの方法と同じである。 | ||
− | |||
* 初期値は「ScreenOrientation.FullUser」となっておりスマホの回転にあわせグルグル回る。 | * 初期値は「ScreenOrientation.FullUser」となっておりスマホの回転にあわせグルグル回る。 | ||
* 横画面に固定したい場合は「ScreenOrientation.Landscape」を指定する。 | * 横画面に固定したい場合は「ScreenOrientation.Landscape」を指定する。 | ||
* 縦画面に固定したい場合は「ScreenOrientation.Portrait」を指定する。 | * 縦画面に固定したい場合は「ScreenOrientation.Portrait」を指定する。 | ||
− | + | <source> | |
− | <source | + | [Activity(Label = "Game1", |
− | [Activity(Label = "Game1", | + | MainLauncher = true, |
− | + | Icon = "@drawable/icon", | |
− | + | Theme = "@style/Theme.Splash", | |
− | + | AlwaysRetainTaskState = true, | |
− | + | LaunchMode = LaunchMode.SingleInstance, | |
− | + | ScreenOrientation = ScreenOrientation.Portrait, | |
− | + | ConfigurationChanges = ConfigChanges.Orientation | | |
− | + | ConfigChanges.KeyboardHidden | | |
− | + | ConfigChanges.Keyboard | | |
− | + | ConfigChanges.ScreenSize)] | |
− | + | public class GameActivity : AndroidGameActivity | |
− | public class GameActivity : AndroidGameActivity | + | { |
− | { | + | } |
− | } | ||
</source> | </source> | ||
== 関連項目 == | == 関連項目 == | ||
− | * [[Xamarin. | + | * [[Xamarin.Android/画面の向きを固定する]] |
[[category: MonoGame]] | [[category: MonoGame]] |