本文介绍了Android Wear 2.0样式的开关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的Android Wear手表做一个表盘,在config活动中我想要一个开关.该开关看起来像一个普通的android开关(图片1 ),但我希望它看起来就像Android Wear 2.0中的新开关一样(图片2 ).谷歌是怎么做到的?

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?

推荐答案

图片2中的开关是 SwitchPreference (至少当前),仅在 PreferenceFragment .

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

这篇关于Android Wear 2.0样式的开关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 21:35