网上的都太复杂了,用法是:
<Switch
android:id="@+id/switch1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
这样就会出现一个系统默认的,选中后会变色的开关:
颜色都是系统theme中的颜色
网上的都太复杂了,用法是:
<Switch
android:id="@+id/switch1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
这样就会出现一个系统默认的,选中后会变色的开关:
颜色都是系统theme中的颜色