Actionbar logo padding left

∥☆過路亽.° 提交于 2019-12-03 16:00:21

You can create xml file(your_xml_file) in folder /res/drawable, like this:

<?xml version="1.0" encoding="UTF-8"?>
<layer-list
    xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:drawable="@drawable/menu_button"
        android:right="20dp"/>


</layer-list>

and add it to code:

<activity android:name=...
            android:logo="@drawable/your_xml_file" >

To reduce the space between the left side of the screen and the logo I used it:

       <style name="AppTheme" parent="android:Theme.Holo">
            <item name="android:actionBarStyle">@style/ActionBarStyle</item>
        </style>

        <style name="ActionBarStyle" parent="@android:style/Widget.Holo.ActionBar">
            <item name="android:layout_marginLeft">-11dp</item>
        </style>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!