APP适配安卓手机刘海屏

若是你想容许全屏界面内容显示到刘海区域 ,只要在AndroidManifest.xml文件里配置以下代码便可:android

<!--容许绘制到oppo、vivo刘海屏机型的刘海区域 --> 
  <meta-data
        android:name="android.max_aspect"
        android:value="2.2" />

    <!--适配华为(huawei)刘海屏-->
    <meta-data
        android:name="android.notch_support"
        android:value="true"/>

    <!--适配小米(xiaomi)刘海屏-->
    <meta-data
        android:name="notch.config"
        android:value="portrait|landscape" />