从这两大部分的阴影样式来看,感觉像是用了两个cardview,一个包含了上面「我的草稿,最近浏览。。等等条目」,另一个包含了「夜间模式」和「设置」,是这样吗?还是说整体就是一个RecyclerView?
另外,item之间的分割线是怎么做的?谢谢
天蓬老师2017-04-17 18:03:10
Because the number of these items is fixed and the number is small, you can write the entire list yourself. The copy style is actually the most efficient. The dividing line is actually a view with margin on the left. Set a background color. Height 1px
PHPz2017-04-17 18:03:10
All pages that look like preference settings can be implemented using the following Fragment:
android.preference.PreferenceFragment, used in native environment
android.support.v7.preference.PreferenceFragmentCompat, for compatible environments
1, 2 have the same basic functions, except that 2 exists for compatibility with lower versions and was introduced in the latest version of support-v7. The list of 1 is implemented using ListView, and the list of 2 is implemented using RecyclerView. In addition, both of them have a set of Preferences, which are Item items in the list, which can meet various needs and can also be customized.
Specific ideas:
[Night Mode], [Settings] is just a Preference
[Night Mode] The above divider is a PreferenceCategory
Write *prefs.xml according to your needs
The layout of p.s.Preference can be set by calling the interface or modifying themes.xml (style)
Specific usage:
Official Document: PreferenceFragment
p.s. For more usage, please Google it.
阿神2017-04-17 18:03:10
For linearlayout, there are showpiders. You can download it from Baidu or Google. It’s very convenient. You don’t need to write View as a dividing line.