Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Padding between ActionBar's home icon and title

Does anybody know how to set padding between the ActionBar's home icon and the title?

like image 691
Alesqui Avatar asked Mar 16 '12 12:03

Alesqui


People also ask

Where is the Action bar on my phone?

Android ActionBar is a menu bar that runs across the top of the activity screen in android. Android ActionBar can contain menu items which become visible when the user clicks the “menu” button.

What is the difference between a Toolbar and an Action bar?

The Toolbar is basically the advanced successor of the ActionBar. It is much more flexible and customizable in terms of appearance and functionality. Unlike ActionBar, its position is not hardcoded i.e., not at the top of an activity.

How to create custom ActionBar in android?

This example demonstrate about how to create a custom action bar in Android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml.


1 Answers

EDIT: make sure you set this drawable as LOGO, not as your app icon like some of the commenters did.

Just make an XML drawable and put it in the resource folder "drawable" (without any density or other configuration).

<?xml version="1.0" encoding="utf-8"?> <layer-list     xmlns:android="http://schemas.android.com/apk/res/android" >      <item         android:drawable="@drawable/my_logo"         android:right="10dp"/>   </layer-list> 

The last step is to set this new drawable as logo in your manifest (or on the Actionbar object in your activity)

Good luck!

like image 67
Cliffus Avatar answered Oct 04 '22 04:10

Cliffus