skip to Main Content

Hey all I’d like help in creating my app in android studio I am new to this so I’ll do my best to try and help you all understand best into what I am trying to do.

I am going to post two pics of how my design should look and I can’t seem to get the start of the title bar done. In android studio it always on all of the project start-ups puts a black title bar with a picture of an android and its all black id like it to be cleared of the photo and re colour’d into red and the title text center’d as in my design image.

any help would be much appreciated
this should show the two pictures of my design

2

Answers


  1. Action bar custom label

    AndroidManifest.xml:

    <activity
       android:name="com.package.app.MainActivity"
       android:label="@string/app_name" >
       <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
       </intent-filter>
    </activity>
    

    You can change the android:label from your app name to your desired title for each activity you have.

    Action bar background color

    To change the action bar background, create a custom theme for your activity that overrides the actionBarStyle property. This property points to another style in which you can override the background property to specify a drawable resource for the action bar background.

    Styling the Action Bar

    Login or Signup to reply.
  2. While you can edit the xml to change the ActionBar, your best bet is going to be using the new Toolbar. A toolbar is a fully customizable ActionBar without a lot of the traditional constraints of it. You can treat the toolbar just like any other layout container and include layout elements inside like TextViews, etc.

    After you have designed your toolbar in xml, you can simply set the toolbar to be your action bar by calling activity.setSupportActionBar(yourToolbar);

    This is much more flexible and allows much more control over the look and feel than using the traditional action bar.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search