Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid custom titlebar style/theme
    text
    copied!<p>I created an activity with a custom titlebar and a button in it, which is extended by all other activites. It works well so far, but when I use an activity whith theme.dialog the titlebar is not shown correct. There is a padding to the left and right of the title and height is limited to 25, I guess.</p> <p>So I tried the same to the <code>theme.dialog windowTitleSize</code> as I did to the theme. But it showed the same result as if I just change only the title of the normal theme - a padding to the left and right and the wrong height.</p> <p>After a lot of googling I found at least one solution that works here on stackoverflow. Unfortunately it fixes the padding for the titlebar at runtime with <code>Class.forName()</code> and <code>getField().</code> I could change the height of the titlebar with <code>layoutParams</code> the same way, but would like to set it all up in <code>xml</code>.</p> <p>I browsed themes.xml in the ..data/res/values but could not find where the limitation of the layout is set. Finally I tried to extend the normal theme and create a dialog myself. That brought me to <code>Widget.PreferenceFrameLayout</code> and the following errors in my xmls: In styles.xml <code>"no resource found..." on all "...android:border..."</code></p> <pre><code>&lt;style name="MyPreference"&gt; &lt;item name="android:borderTop"&gt;20dp&lt;/item&gt; ... &lt;/style&gt; </code></pre> <p>And in themes.xml "no resource found...android:preferenceFrameLayoutStyle"</p> <pre><code>&lt;style name="MyThemeDialog" parent="android:Theme"&gt; ... &lt;item name="android:preferenceFrameLayoutStyle"&gt;@style/MyPreference&lt;/item&gt; ... &lt;/style&gt; </code></pre> <p>How am I supposed to use the given themes and styles the right way to set up the titlebar in theme.dialog?</p> <p><strong>-----edit-----</strong></p> <p>I recognized, that the mentioned attributs are not available in the attrs.xml of api8, so sorry for the hasted asked question. Sometimes I just can't see the forest because of all the trees.</p> <p>Thanks in advance for your help,</p> <p>Christel</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload