I am trying to set custom icon for home icon using ActionBarSherlock library. I have tried to set custom layout using abHomeLayout
attribute in my custom theme. But it didn't work for me. Only way, how to set it, is to set abIcon
attribute for my custom drawble, but I cannot set some horizontal padding for this drawable. Is there any example for this or where could be a problem with abHomeLayout
attribute?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
I had similar issue with incorrect padding of the home icon on devices api<11 (i.e not the fully fledged platform action bar) and the
abHomeLayout
style only worked api>11My solution was to copy the
abs__action_bar_home.xml
layout from ABS to child project and manually add padding to theabs__home
imageviewThis works for my situation, it replaces the default ic_launcher icon in the action bar with my custom one.
In your onCreate do this:
Or in the manifest you can set the logo:
This works great too:
Reference: How to change the ActionBar “Home” Icon to be something other than the app icon?
Define an own style, like this:
I think here your can use
abHomeLayout
. Set this style for your activity like this:In MainActivity you can use getSupportActionBar()... functions.