近期客户需求,状态栏只显示时间和电池图标,如图
状态栏图标的布局文件在frameworks\base\packages\SystemUI\res\layout\status_bar.xml,主要包括通知,定位,蓝牙,信号,时间,电池等图标,只要在相应的布局文件中加入属性android:visibility="invisible" 或者“gone”即可
<?xml version="1.0" encoding="utf-8"?><!--**** Copyright 2006, The Android Open Source Project**** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at **** http://.android.systemui.BatteryMeterView android:id="@+id/battery" android:layout_height="match_parent" android:layout_width="wrap_content" /></LinearLayout>总结
到此这篇关于Android 8.1隐藏状态栏图标的实例代码的文章就介绍到这了,更多相关android 隐藏状态栏图标内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!