Android Wear 2.0 styled switches

淺唱寂寞╮ 提交于 2019-11-29 23:54:07

问题


I'm making a watch face for my android wear watch and in the config activity I want a switch. The switch looks like a usual android switch (picture 1) but I want it to look like the new switchs in android wear 2.0 (picture 2). How did google do them?


回答1:


The switch in picture 2 is a SwitchPreference which is (at least currently) only supported in a PreferenceFragment.




回答2:


In the latest update we added a RoundSwitch style which should do exactly what you need.

See here: Support Library Wear R.style



来源:https://stackoverflow.com/questions/43830167/android-wear-2-0-styled-switches

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!