Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>why you relay on android for title bar just design your title bar as you want and set it at top in your main layout and use following code in onCreate before setting layout</p> <pre><code>requestWindowFeature(Window.FEATURE_NO_TITLE); </code></pre> <p>here is example... define your title bar in your main layout like if you are setting main.xml as you activity's layout then your main.xml should be like</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" &gt; //here i have used LinearLayout as example your's can be Relative or whatever //here my title bars layout starts containing an icon and a text your's can containing just text or whatever you want &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/my_title_background" android:orientation="horizontal" &gt; &lt;ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginLeft="15dip" android:src="@drawable/my_icon" /&gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginLeft="15dip" android:text="My Application title" android:textColor="#FFFFFF" /&gt; &lt;/LinearLayout&gt; //and here rest of your layut for your application functionality &lt;/LinearLayout&gt; </code></pre> <p>then in my activities java file which containing onCreate() method the code will be like that</p> <pre><code> /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); //restof code for my class </code></pre> <p>you dont need to set any thing else for your title bar like setting themes and setting other features or permissions.......... i hope you got it</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