navasmdc / MaterialDesignLibrary

This is a library with components of Android L to you use in android 2.2
Apache License 2.0
8.99k stars 2.22k forks source link

Error putting switch in layout #72

Open borjaruiz opened 9 years ago

borjaruiz commented 9 years ago

I am defining a switch in a layout this way:

<com.gc.materialdesign.views.Switch
            android:id="@+id/switchView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#1E88E5"
            materialdesign:check="true" />

And I get this error: No resource identifier found for attribute 'check' in package com.mypackage...

I have also put this line on the first layout: xmlns:materialdesign="http://schemas.android.com/apk/res-auto"

I have no problem with rectangleButton. Where am I wrong? Thanks in advance

kaleai commented 9 years ago

You should use checked instead of check.

borjaruiz commented 9 years ago

Thanks! That was! The "how to use" instructions are wrong!!

kaleai commented 9 years ago

Yes,I'll pull new request to author.

26077jia commented 7 years ago

What attributes can be set in the XML of Switch?