关于在xml文件中的 error: invalid symbol: 'switch' 错误
在xml布局文件中使用Switch控件时,出现error: invalid symbol: 'switch'报错,代码如下:
<Switch
android:id="@+id/switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOn="开启"
android:textOff="关闭" />
原因是在设置其id时使用了关键字(如switch,case等),将其替换成非关键字即可。
posted on 2014-11-07 00:16 hackerkevin 阅读(983) 评论(0) 收藏 举报
浙公网安备 33010602011771号