问题描述
这似乎AppCompat V21提供SwitchCompat不提供SwitchCompatPerefrence。
It seems AppCompat v21 provides SwitchCompat does not provide SwitchCompatPerefrence.
我知道我可以使用切换preference但它不是视觉上相同。在Android 4.x的;当我使用SwitchCompact从V21上的活动界面,它看起来像材料开关按键,但是,因为没有SwitchCompact preference我必须使用交换机preference我pereference观点,显然它的Android 4.0的样子。
I know I can use SwitchPreference but it is not visually identical. On Android 4.x; when I use SwitchCompact from v21 on activity interface, it looks like material switch button, but, because there is no SwitchCompactPreference I have to use SwitchPreference in my pereference view and obviously it has Android 4.0 look.
看起来AppCompact V21完成了一半。
It looks like AppCompact v21 half complete.
我缺少的东西?
推荐答案
下面是一个code片段显示材料交换机甚至在旧版本。 https://gist.github.com/cgollner/5b31123c98b2c1cad8dc https://gist.github.com/cgollner/3c7fe2f9d34aee38bd0c
Here is a code snippet displaying material Switches even on older versions.https://gist.github.com/cgollner/5b31123c98b2c1cad8dchttps://gist.github.com/cgollner/3c7fe2f9d34aee38bd0c
参考: https://plus.google.com/118168530059850940658/posts/badausxo1J6
这篇关于Android的AppCompat V21提供SwitchCompat不提供SwitchCompatPerefrence的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!