Android initialExpandedChildrenCount高级菜单折叠项或铺展折叠项

/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/xml/system_dashboard_fragment.xml

<PreferenceScreen

xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:settings="http://schemas.android.com/apk/res-auto"

android:key="system_dashboard_screen"

android:title="@string/header_category_system"

settings:initialExpandedChildrenCount="4">

意思是,超过4个菜单则折叠隐藏起来,否则没超过直接平铺展开显示!

@Override

public void onCreate(Bundle icicle) {

super.onCreate(icicle);

final PreferenceScreen screen = getPreferenceScreen();
// We do not want to display an advanced button if only one setting is hidden
if (getVisiblePreferenceCount(screen) == screen.getInitialExpandedChildrenCount() + 1) {
screen.setInitialExpandedChildrenCount(Integer.MAX_VALUE);
}

}

相关推荐
hjlgs7 小时前
framework修改快速验证
android
游戏开发爱好者87 小时前
iOS 开发者的安全加固工具,从源码到成品 IPA 的多层防护体系实践
android·安全·ios·小程序·uni-app·cocoa·iphone
安卓理事人8 小时前
安卓内存泄露排查LeakCanary
android
秃了也弱了。9 小时前
MySQL空间函数详解,MySQL记录经纬度并进行计算
android·数据库·mysql
.豆鲨包10 小时前
【Android】Binder机制浅析
android·binder
Nerve11 小时前
GooglePay: API 文档
android·google
Nerve12 小时前
GooglePay: 订阅商品购买流程
android·google
summerkissyou198712 小时前
Audio-触摸音-播放流程
android
Nerve12 小时前
GooglePay: 消耗商品购买流程
android·google
LiteHeaven12 小时前
Android 8.1 Unable to create application data 问题分析
android