加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 使用Zxing库,Xamarin.android应用程序扫描时,将屏幕方向锁

发布时间:2020-12-16 01:05:11 所属栏目:百科 来源:网络整理
导读:我已经看到它可以在相机配置管理器中完成,但不知道在哪里找到该文件??? 我已经添加: activity android:name="MainActivity" android:configChanges="keyboardHidden|orientation" android:screenOrientation="portrait"/ 现在主要活动被锁定在肖像上,但是当
我已经看到它可以在相机配置管理器中完成,但不知道在哪里找到该文件???

我已经添加:

<activity android:name="MainActivity"

          android:configChanges="keyboardHidden|orientation" 

          android:screenOrientation="portrait"/>

现在主要活动被锁定在肖像上,但是当从内部活动运行zxing扫描仪时,屏幕在扫描期间旋转?

解决方法

将其添加到Main活动以锁定方向

[Activity (Label = "YourLabel",MainLauncher = true,ScreenOrientation = Android.Content.PM.ScreenOrientation.Landscape)]

要使用代码更改方向,请使用以下命令:

if (scanning)
    RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读