tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[feat] App orientation for iOS / Android.

Open aleph1 opened this issue 7 months ago • 2 comments

Describe the problem

It isn't clear from the config / API docs from V2 as to whether an app can be forced to remain in a specific orientation. I am migrating an app from Cordova and this is possible, but I can't find a similar setting for Tauri V2. Is this possible?

Describe the solution you'd like

Ideally a simple configuration option for orientation = landscape or portrait, or to automatically change orientation if no option is set.

Alternatives considered

No response

Additional context

No response

aleph1 avatar May 09 '25 17:05 aleph1

Reposting what i wrote in https://github.com/tauri-apps/tauri/discussions/13407 for a workaround until a config is exposed:

For Android you can edit the AndroidManifest.xml file in src-tauri/gen/android and add android:screenOrientation="landscape".

For iOS you can configure it in xcode somewhere (probably in some file manually as well but idk). In the project settings > General > Deployment Info > iPhone/iPad orientation

FabianLars avatar May 10 '25 08:05 FabianLars

For iOS you can set this in your Info.plist i.e.

<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>

velocitysystems avatar Jun 03 '25 12:06 velocitysystems