android上的状态栏重叠应用 [英] Status bar overlap application on android
问题描述
我正在学习本机脚本 本课程关于udemy和我的代码的第一行,我在Android上遇到了问题.
I'm learning native script by following this course on udemy and on the first lines of my code, I'm facing a problem on Android.
我刚刚创建了一个带有 Stacklayout 和标签的组件.当我在 ios 和 android 模拟器上运行它时,在 ios 上一切正常.但在 android 上,标签在状态栏后面.我试图在我真正的 android 设备上运行它,结果是一样的.项目真的很简单,我基本都是跑TNS create的,把不需要的组件和路由的东西都删了,然后加了这个很基础的组件.根本不涉及任何 css 规则.
I just created a component with a Stacklayout and inside a Label. When I run this on both ios and android emulator, everything is ok on ios. But on android the label is behind the status bar. I tried to run it on my real android device and the result is the same. The project is really simple, I basically ran TNS create, deleted all unnecessary components and routing stuff.Then added this very basic component. No css rules at all are involved.
在这个课程视频中,老师没有这个问题.我的配置有什么问题?
In this video of the course, the teacher doesn't have this problem. What is wrong with my config?
推荐答案
我遇到了同样的问题,现在通过更改以下代码来解决:
I encounter the same issue and it is now fixed by changing below code:
导航到 App_Resources/Android/src/main/res/values/styles.xml
和 values-v21/styles.xml
然后将下面的代码设为 false
而不是 true
或完全删除它.
and either make the below code false
instead of true
or totally remove it.
<item name="android:windowTranslucentStatus">true</item>
它将解决您的问题.
这篇关于android上的状态栏重叠应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!