I have a custom home icon for my app and I want it to align all the way to the left of the actionbar, so that it's touching the edge of the screen. Is this possible, and if so, how can it be done? I don't see anything that sets the padding or margin to make it align all the way to the left.
相关问题
- 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 finally managed to get this. You need to use a custom actionbar view. It's actually quite easy:
(This is using ActionbarSherlock, it should work with the stock compat library also...)
First in your res/values/themes.xml, set the actionbar display options to "custom":
Then create a file called res/layout/actionbar_layout.xml and place in it something like:
Next, in your activity code add the following:
That's basically it! Let me know if there's anything I left out. There are some nice benefits of having a customisable actionbar view, just stick to the basics and it will look great.