Jav*_*oba 17 icons android android-appcompat navigation-drawer android-5.0-lollipop
我有使用工具栏的新方法的问题.在横向模式下,工具栏标题垂直居中,但导航抽屉不居中.我怎么解决这个问题?
我正在使用像Chris Banes这篇文章中的工具栏: AppCompat v21 - 前棒棒糖设备的材料设计!
这是style.xml中抽屉图标的代码:
<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="spinBars">true</item>
<item name="color">@android:color/white</item>
</style>
Run Code Online (Sandbox Code Playgroud)
这是问题的图像: 景观图像
编辑:溢出按钮也不垂直居中......
Eug*_*nec 29
这是我的工具栏主题,所有内容都正确居中:
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
style="@style/Widget.MyApp.Toolbar">
</android.support.v7.widget.Toolbar>
Run Code Online (Sandbox Code Playgroud)
该示例说使用android:minHeight="?actionBarSize",android:_layout_height="wrap_content"但它只产生您描述的错误.
小智 6
在工具栏样式中添加:
<item name="maxButtonHeight">?attr/actionBarSize</item>
Run Code Online (Sandbox Code Playgroud)
这允许您使用wrap_content高度并仍然具有居中图标!
| 归档时间: |
|
| 查看次数: |
5250 次 |
| 最近记录: |