android - Standard ActionBar icon without default left-margin / padding -


with holo theme api level > 14 retrieve kown left margin icon in actionbar follows:

<style name="appbasetheme" parent="@android:style/theme.holo"> 

enter image description here

when applying material-theme appcompat_v7 support (not changing code or using preferred new toolbar instead) left margin missing.

<style name="appbasetheme" parent="@style/themeoverlay.appcompat.dark.actionbar"> 

enter image description here

why , how fix ?

as first workaround added layer list drawable resource named icon.xml res/drawable/ this:

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

and referenced drawable logo instead of original icon in androidmanifest.xml:

        <activity             android:logo="@drawable/icon" ... 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -