<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:toggle="http://schemas.android.com/apk/res-auto"
style="@style/base_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/lightgrey"
android:orientation="vertical" >
<com.zcw.togglebutton.ToggleButton
android:id="@+id/toggle_wifi"
android:layout_width="54dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:clickable="true"
toggle:onColor="#6f6fff"
>
</LinearLayout>
如上代码块,其中
xmlns:toggle="http://schemas.android.com/apk/res-auto"
就是需要我们添加的,不然会报错:
error: Error parsing XML: unbound prefix