欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 科技 > 名人名企 > 在Android 15的设备上关闭edge-to-edge功能

在Android 15的设备上关闭edge-to-edge功能

2025/2/5 13:51:39 来源:https://blog.csdn.net/spy2000/article/details/145183379  浏览:    关键词:在Android 15的设备上关闭edge-to-edge功能

Android 15在开发上有很多更新,当APP的targetSdk设置为35,且设备系统为Android 15时,APP会自动启动edge-to-edge功能。虽然可视面积变大了,但界面布局也会受影响。

如果要强制关闭edge-to-edge功能。可以在style.xml中将windowOptOutEdgeToEdgeEnforcement设置为false,并且指定targetApi为35。

<style name="AppTheme" parent="AppBaseTheme"><item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
</style>

然后修改AndroidManifest.xml,将对应activity或application的theme设置为刚才修改的style即可。

参考网址:

https://speakerdeck.com/error96num/edge-to-edge-qiang-zhi-henodui-ying

https://developer.android.com/about/versions/15/behavior-changes-15

https://developer.android.com/reference/android/R.attr#windowOptOutEdgeToEdgeEnforcement
 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com