Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple parents in Android styles xml

When using android styles, one can specify a parent style like:

<style name="MyStyle" parent="@style/ParentStyle"></style>

Is is possible to specify multiple parents? If so, how?

like image 728
Rollin_s Avatar asked Dec 15 '10 20:12

Rollin_s


People also ask

Can we compose two or more styles?

Styles do not support multiple inheritance.

What is parent style android?

Parent attribute means that your current themes extends this Parent theme. It has all its attributes that you can override in your current style. It is a kind of inheritance for styles.

Where is Styles XML in Android?

Styles and themes are declared in a style resource file in res/values/ , usually named styles. xml .


1 Answers

According to documentation, the syntax for parent attribute value is @[package:]style/style_to_inherit (where package: is optional) so a reference to just a single style resource is allowed.

like image 149
Xion Avatar answered Oct 02 '22 00:10

Xion