c# - How to manage the orientations a Uno App supports on at least iOS?
问题描述
Normally, the orientations that an iOS supports are either defined by the app's Info.plist file. or the application delegate's supportedInterfaceOrientations
. However, this doesn't seem to work in that way with Uno. How should this be done instead?
解决方案
Since the implementation of the DisplayInformation
class in Uno, the application references its AutoRotationPreferences
property by default, instead of referencing the Info.plist configuration.
To exclude or include a orientation from the AutoRotation behaviour you can set this in code:
using Windows.Graphics.Display;
...
DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait;
推荐阅读
- sonarqube - 如何使用 SonarQube 7.9 在 BitBucket(云)管道中装饰 PullRequest
- ios - SWIFT:如果我以编程方式实现 UITAB 栏,是否可以在 storyBoard 中编辑不同的 tabItems
- dataweave - 通过 Dataweave 进行 JSON 转换
- regex - 正则表达式 - 在字符串中查找特定单词,无论是前面还是后面都没有或没有任何非字母
- vue-router - Vue路由器,错误:通过导航守卫将*重定向到*
- php - My code in laravel can't call back data from data base to update
- c# - 使用设计器将 BackgroundWorker 组件拖放到表单上,或仅通过代码实例化变量之间的区别
- node.js - puppeteer show result in screenshot but cant get value of that result
- wordpress - How to build the head tag?
- html - 引导数据表无法与 thymeleaf th:block 一起正常工作