Search code examples
androidpixate

pixate-freestyle-android define style class in XML layout


I'm using the pixate-freestyle-android library in my app. I want to define style class in XML layout.

In docs I found the following:

// Setting a class for a Button
Pixate.setStyleClass(button, "myButton");

This is equivalent to defining a class in the XML layout.

<Button
    class="myButton"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="@string/myButtonStr"
    android:textSize="16sp" />

If I define those programmatically in code - it works. But if I define those in XML layout, like above, Android Studio indicates me "Unknown attribute class" at this line and it doesn't work:

<Button
    ...
    class="myButton"
    ... />

Is it possible to define style class in XML layout?


Solution

  • Attribute class="myButton" can no longer be set in the latest version of library, only programmatically.