Does anybody know how to set padding between the ActionBar's home icon and the title?
相关问题
- 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
You can achieve same by method as well:
This is how I was able to set the padding between the home icon and the title.
I couldn't find a way to customize this via the ActionBar xml styles though. That is, the following XML doesn't work:
However, if you are looking to achieve this through xml, these two links might help you find a solution:
https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml
(This is the actual layout used to display the home icon in an action bar) https://github.com/android/platform_frameworks_base/blob/master/core/res/res/layout/action_bar_home.xml
When you are using a custom Toolbar, you can use
and in your toolbar layout simply set
app:titleMarginStart="16dp"
Note that you have to set the icon as a logo, don't use
getSupportActionBar().setIcon(R.drawable.logo)
instead use:getSupportActionBar().setLogo(R.drawable.logo)