0

I'm trying to make a custom titlebar for my first Android application.

While I can find lots on the web about how to make them so you can change colours etc, I want my titlebar to look the same as the "standard" titlebar, but with a button that I can configure. This means copying the device's currently active themes to be able to style it in exactly the same way.

Not all devices simply use a gradient in the titlebar style, so adding a gradient (as suggested in other SO questions) doesn't really make sense.

Does anyone have any pointers how to read the style information?

Hippyjim
  • 2,520
  • 6
  • 38
  • 54

1 Answers1

0

try to extend an existing theme e.g. create your own style which can ofcourse extend from existing from an existing theme. change the windowNoTitle to true.

  <?xml version="1.0" encoding="utf-8"?>
  <resources>
  <style name="noTitleBarStyle" parent="android:Theme.Black">
  <item name="android:windowNoTitle">true</item>
  <item name="android:windowBackground">@color/darkGrey</item>   
  <item name="android:colorForeground">#ff3333</item> 
  </style></resources>

or try to do it runtime as discussed here Android - change custom title view at run time

I hope this helps.

Community
  • 1
  • 1
Orlymee
  • 2,349
  • 1
  • 22
  • 24
  • That didn't exactly do what I needed, but I ended up just making up my own styling anyways, and your code helped - thnaks Orlymee – Hippyjim Mar 05 '12 at 11:59