我在应用程序中使用工具栏,并且将TextVIEw自定义为工具栏的中心,但是它不是工具栏屏幕的全宽,并且在左侧保留了一个小屏幕,如下图所示.那么,如何使“自定义TextVIEw”成为屏幕和工具栏的中心呢?
我当前的屏幕问题:
我想要的屏幕:
<?xml version="1.0" enCoding="utf-8"?> <androID.support.v7.Widget.Toolbar androID:ID="@+ID/toolbar" xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:layout_wIDth="match_parent" androID:layout_height="50dp" androID:background="@color/colorPrimary" app:theme="@style/themeOverlay.AppCompat.Dark" xmlns:app="http://schemas.androID.com/apk/res-auto"> <TextVIEw androID:ID="@+ID/tv_Title" androID:textcolor="#FFF" androID:background="#F00" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:text="Title" androID:textStyle="bold" androID:textSize="15sp" androID:gravity="center"/> </androID.support.v7.Widget.Toolbar>
谢谢!
解决方法:
在您的工具栏中添加以下属性以删除“左填充”.
app:contentInsetleft="0dp" app:contentInsetStart="0dp"
总结 以上是内存溢出为你收集整理的Android Studio中没有全角工具栏?全部内容,希望文章能够帮你解决Android Studio中没有全角工具栏?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)