Styles, minHeight / maxHeight: I can't get maxHeight to override the minHeight theme

I think that more "global" styles are always redefined by more "local" styles. For example, if I redefine all the buttons to have textSize = 40dip (apply this style as the theme for the application) and then apply a different style to the specific button that says textSize = 10dip, then that particular button should get 10dip textSize.

And so it works. But not when it comes to maxHeight. Here is the scenario:

In my styles.xml , I have one style where I inherit the default button and change textSize and minHeight, and then another style that sets some other values ​​(but also inherits from Button), for example

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Button" parent="@android:style/Widget.Button">
    <item name="android:textSize">26dip</item>
    <item name="android:minHeight">60dip</item>
</style>

<style name="ButtonHeader" parent="@android:style/Widget.Button">
    <item name="android:textSize">18dip</item>
    <item name="android:minWidth">70dip</item>
    <item name="android:maxHeight">10dip</item>
</style>
</resources>    

, (minHeight = 60dip). "" ( ), minHeight 60dip, ButtonHeader, maxHeight 10dip.

header.xml :

<Button style="@style/ButtonHeader" android:text="UPP" android:id="@+id/Header_Button_UPP" android:layout_width="wrap_content" android:layout_height="wrap_content" ></Button>
<Button style="@style/ButtonHeader" android:text="ALT" android:id="@+id/Header_Button_ALT" android:layout_width="wrap_content" android:layout_height="wrap_content" ></Button>
<Button style="@style/ButtonHeader" android:text="NAV" android:id="@+id/Header_Button_NAV" android:layout_width="wrap_content" android:layout_height="wrap_content" ></Button>
<Button style="@style/ButtonHeader" android:text="HIS" android:id="@+id/Header_Button_HIS" android:layout_width="wrap_content" android:layout_height="wrap_content" ></Button>

, "" . ; textSize 18dip, maxHeight - 60dip.

I, ButtonHeader, android: minHeight = "100dip", 100dip, . , , android: maxHeight, .

?

+5
2

ButtonHeader minHeight? , minHeight = 60dp maxHeight = 10dp, minHeight . minHeight - , .

+5

(Button - HeaderButton), HeaderButton minHieght MaxHeight ( - ), MinHeight ,

, MinHeight 18dip-, ,

, .

0

All Articles