要设置透明状态栏,可以通过以下步骤来实现:
<View
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent" />
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
通过以上步骤,你就可以在Android应用中设置透明状态栏了。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:Android半透明状态栏怎样设置