有没有类似一起做网店的网站,找设计工作哪个网站好,番禺网站开发哪家好,外贸网站定制公司在Android12以上的手机#xff0c;设置全屏后屏幕底部有黑边或者白边#xff0c;有的屏幕顶部有黑边。解决方案很简单#xff0c;在使用的主题中添加对应的设置即可#xff0c;如下#xff1a; res/values/themes.xml resourcesstyle nameBase.Theme.La…在Android12以上的手机设置全屏后屏幕底部有黑边或者白边有的屏幕顶部有黑边。解决方案很简单在使用的主题中添加对应的设置即可如下 res/values/themes.xml resourcesstyle nameBase.Theme.Laughf parentTheme.Material3.DayNight.NoActionBar!--全屏后顶部状态栏将不显示--item nameandroid:windowFullscreentrue/item!--使屏幕顶部的状态栏透明--item nameandroid:windowTranslucentStatustrue/item!--使屏幕底部的导航栏透明有的手机是半透明--item nameandroid:windowTranslucentNavigationtrue/item /stylestyle nameTheme.Laughf parentBase.Theme.Laughf /
/resourcesres/values-v27/themes.xml ?xml version1.0 encodingutf-8?
resourcesstyle nameBase.Theme.Laughf parentTheme.Material3.DayNight.NoActionBar!--全屏后顶部状态栏将不显示--item nameandroid:windowFullscreentrue/item!--使屏幕顶部的状态栏透明--item nameandroid:windowTranslucentStatustrue/item!--使屏幕底部的导航栏透明有的手机是半透明--item nameandroid:windowTranslucentNavigationtrue/item!--在我的小米11pro(android13) 上虽然状态栏隐藏了但是原状态位置上会被显示黑色。用下面的属性可解决但是它是在API27才出的所以需要声明在v27的文件夹中--item nameandroid:windowLayoutInDisplayCutoutModeshortEdges/item/style
/resources使用主题 ?xml version1.0 encodingutf-8?
manifest xmlns:androidhttp://schemas.android.com/apk/res/androidxmlns:toolshttp://schemas.android.com/toolsapplicationandroid:iconmipmap/ic_launcherandroid:labelstring/app_name android:themestyle/Theme.Laughfactivityandroid:name.MainActivityandroid:exportedtrueintent-filteraction android:nameandroid.intent.action.MAIN /category android:nameandroid.intent.category.LAUNCHER //intent-filter/activity/application/manifest这里把主题应用到了application则所有的界面都会全屏也可单独把主题设置到需要全屏的Activity上。
这种全屏后有个问题如果在界面的底部有按钮且系统启用了虚拟导航栏则我们界面的按钮可能显示在虚拟导航栏的下方这样导致点击不了下面的按钮。这种情况可以看看怎么获取虚拟导航栏的高度然后给界面设置一个marginBottom。