0

I want to my title bar be static.Means i dont want to move with other stuff .How can i do that?

MyCode:`

<LinearLayout android:layout_height="44dip"
                      android:layout_width="320dip"

                      android:background="@drawable/header_320_44dip">
            <ImageView
                    android:layout_width="121dip"
                    android:layout_height="32dip"
                    android:layout_gravity="center"
                    android:layout_marginLeft="90dip"
                    android:background="@drawable/logo_121_32dip">

            </ImageView>
            <Button
                    android:layout_height="34dip"
                    android:layout_width="64dip"
                    android:id="@+id/btn_hello_what"
                    android:layout_marginLeft="38dip"
                    android:background="@drawable/btn_nedit_nontext_64x34">
            </Button>
        </LinearLayout>`
DuyguK
  • 4,250
  • 9
  • 33
  • 46

2 Answers2

0
 final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);


       if ( customTitleSupported ) 
         {

     getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.mytitle);
        }

        final TextView myTitleText = (TextView) findViewById(R.id.myTitle);
        if ( myTitleText != null ) 
          {
            myTitleText.setText("YOUR TITLE HERE");

        }
Rashmi.B
  • 1,787
  • 2
  • 18
  • 34
0

You want to set some header view to all your activity then this answer may be helpful to you.

And you can also use the default title bar of the android app to customize see this post

Community
  • 1
  • 1
MKJParekh
  • 34,073
  • 11
  • 87
  • 98