这是我一个月(夏季学校)不从事我的项目后发生的。我刚回到它时,发现更新Android Studio后,工具栏上的间隙比正常情况大。我在SO上找不到关于此的任何问题/解决方案。如果有人可以提供帮助,将不胜感激。
我通过这样做来加载汉堡包图标(每行都正确放置在应用程序中的类声明,onCreate()等中。为简单起见,我将其放置为这样):
ActionBarDrawerToggle mDrawerToggle;
mDrawerToggle = new ActionBarDrawerToggle(getActivity(), dl, toolbar, R.string.nav_open, R.string.nav_closed)
mDrawerToggle.syncState();
这是我的工具栏的xml代码:
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
app:title="Test Title">
</android.support.v7.widget.Toolbar>
我尝试弄乱各种contentInset
xml属性,但没有一个影响菜单图标后的间距。
编辑:此链接显示了我曾经拥有的内容(位于页面中间)。如果您注意到标题和汉堡图标之间的间距,则该间距不如此处所示的图片宽。好像间距增加了一倍之类。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句