简体   繁体   English

如何在Android中使用Switch小部件

[英]How to use the Switch widget in android

I working on Android Views and using Switch View in my design. 我正在使用Android View,并在设计中使用了Switch View。 I'm getting errors like: 我收到如下错误:

Missing styles. 缺少样式。 Is the correct theme chosen for this layout? 是否为此布局选择了正确的主题? Use the Theme combo box above the layout to choose a different layout, or fix the theme style references. 使用布局上方的“主题”组合框选择其他布局,或修复主题样式引用。

Failed to find style 'switchStyle' in current theme java.lang.NullPointerException Exception details are logged in Window > Show View > Error Log 在当前主题java.lang.NullPointerException中找不到样式'switchStyle'异常详细信息记录在窗口>显示视图>错误日志中

I am unable to fix this error can anyone please help. 我无法解决此错误,任何人都可以帮忙。

Also share your implementation on this topic. 同时分享有关此主题的实现。

我通过更改活动主题来解决它,使用DeviceDefault主题,它将起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM