Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 563053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:37:09+00:00 2026-05-13T12:37:09+00:00

Im thinking that more global styles are always overridden by more local Styles. For

  • 0

Im thinking that more “global” styles are always overridden by more “local” Styles. For example, if I redefine all Buttons to have textSize=40dip (apply that Style as a Theme for the Application) and then apply another Style to a specific Button that says textSize=10dip, then that specific Button should get 10dip textSize.

And that is how it works, usually. 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), like this:

<?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>    

I apply the first Style as a theme for my Activity which makes all the buttons larger (minHeight=60dip). But I have a “header” (where I have some other buttons) that I do not want to have a minHeight of 60dip, and for those buttons I want to use the ButtonHeader, setting the maxHeight to 10dip.

In my header.xml it looks like this:

<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>

I am specificly styling the buttons, overriding the “global” theme. It works in some parts; the textSize for these header-buttons is correctly set to 18dip, but the maxHeight is ignored – these buttons also increase in height to 60dip.

If I, in the style for ButtonHeader, set android:minHeight=”100dip” the buttons in the header will increase in size to 100dip, overriding the Theme.
But, as stated above, when I have android:maxHeight instead, nothing happens.

What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:37:09+00:00Added an answer on May 13, 2026 at 12:37 pm

    Shouldn’t your ButtonHeader style override the minHeight property? It seems like you end up with minHeight=60dp and maxHeight=10dp, and minHeight wins. If you explictly set the minHeight to something else, you shouldn’t have that problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm thinking that google is fall down with layout for these phone. is more
I was thinking that I would have two tables for mysql. One for storing
I was thinking that at the top of my partial I would have something
Am I correct in thinking that that Python doesn't have a direct equivalent for
Am I correct in thinking that if I have a WCF OperationContract takes in
We have an application that works with financial data that is schemaless. More accurately,
I've been always thinking that DOMNodeInsertedIntoDocument/DOMNodeRemovedFromDocument events should not bubble, and for me that
Thinking that the answer to this is pretty obvious but here it goes: When
Am I right in thinking that until I am able to afford dedicated servers
I was thinking that the SQLDataReader should not work if there is no connection

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.