Is it possible to create the title in the Action Bar with more than one line? I need a double spaced 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
No, but you can replace the icon with a separate logo graphic (
android:logo
and thensetDisplayUseLogoEnabled()
). You could embed your two-line title as part of the logo graphic and then not show the original title string viasetDisplayShowTitleEnabled()
. AFAIK, that combination should work.I am not quite sure if you were looking for the following, but:
actionBar.setSubtitle(String string) sets a second line with smaller font underneath your main Title.
example:
The default TextView on the ActionBar does not support line wrapping, and there is no exposed method to set it to wrap. So create a flexible layout, like this: action_bar_title_layout.xml:
Then set this as the custom layout on your ActionBar:
I found a better solution that works perfectly up to Android 4.2.2 where the icon and the title are one clickable item.
If you are using ActionBarSherlock, use this code: