若是你想容許全屏界面內容顯示到劉海區域 ,只要在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" />