美文网首页
Egret Native 使用刘海屏水滴屏区域

Egret Native 使用刘海屏水滴屏区域

作者: 简单点的笨演员 | 来源:发表于2020-10-20 16:22 被阅读0次

    Egret Native 默认不使用刘海屏水滴屏区域,如果要使用,可以修改nativeAndroid.config或_native.config的属性更改工程设置:

    
    //Android项目发布设置详见doc目录下的README_ANDROID.md
    
    public class MainActivity extends Activity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
    
            ...
    
            nativeAndroid.config.showFPS = true;
            nativeAndroid.config.fpsLogTime = 30;
            nativeAndroid.config.disableNativeRender = false;
            nativeAndroid.config.clearCache = false;
            nativeAndroid.config.loadingTimeout = 0;
            // 使用刘海屏水滴屏区域
            nativeAndroid.config.immersiveMode = true;
            nativeAndroid.config.useCutout = true;
    
            ...
    

    使用刘海屏水滴屏区域的效果示例:


    图片来源:https://developer.android.com/guide/topics/display-cutout/

    参考:
    https://bbs.egret.com/thread-57632-1-1.html

    相关文章

      网友评论

          本文标题:Egret Native 使用刘海屏水滴屏区域

          本文链接:https://www.haomeiwen.com/subject/pzpdmktx.html