Singed
Singed

Reputation: 1113

What is the correct style parent definition

When looking at the examples of defining style parent I noticed two different approaches are used for explicit parenting:

Number one:

<style name="MyButton" parent="android:Widget.Button"/>

Number two:

<style name="MyButton" parent="@android:style/Widget.Button"/>

As far as I could see, they both seem to work. I wonder if both of these approaches are correct or there is one I should stick to?

Upvotes: 0

Views: 54

Answers (1)

Eric B.
Eric B.

Reputation: 4702

Both are correct, but stick to this:

<style name="MyButton" parent="@android:style/Widget.Button"/>

As this accesses your current compileSdkVersion's resource directory.

Upvotes: 1

Related Questions