How do you edit title bar?

5.5k Views Asked by At

I need to get my title bar to be orange instead of the standard gray and I can't figure out how to edit it's settings. I also need to align the text so its on the right side of the title bar instead of the left. Any ideas on how to do this?

2

There are 2 best solutions below

0
On
0
On

To give the title bar your desired color(orange), use the following code in your oncreate,

   this.setTitleColor(#FF6600);

or create a custom title bar and use it throughout the application. U can do all kinds of modifications if you create your custom title bar.

eg.

     <?xml version="1.0" encoding="utf-8"?>
     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="400px" 
      android:layout_height="fill_parent"
       android:orientation="horizontal">

      <ImageView android:id="@+id/ImageView01" 
        android:layout_width="57px" 
        android:layout_height="wrap_content"
        android:background="@drawable/icon1">

      </ImageView>

     <TextView 

     android:id="@+id/myTitle" 
     android:text="This is my new title" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:textColor="@color/titletextcolor"
     />
       </LinearLayout>