效果图为:
为了使层级结构更低,这里推荐使用LSettingItem的框架,代码少,而且性能好,层级低,能让用户有更好的体验
第一步:添加依赖
第二步:在.xml写入代码
<com.leon.lib.settingview.LSettingItem android:id="@+id/lsScanMine" android:layout_width="match_parent" android:layout_height="wrap_content" leon:leftIcon="@mipmap/ic_scan_mine" leon:leftText="扫描控制设备" leon:rightStyle="iconHide" /> <com.leon.lib.settingview.LSettingItem android:id="@+id/item_update" android:layout_width="match_parent" android:layout_height="wrap_content" leon:isShowUnderLine="true" leon:leftIcon="@mipmap/ic_checkupdate" leon:leftText="检查更新" />