Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/218.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 应用程序:collapsedTitleGravity=";中心“;不';我不能正常工作_Android_Android Support Library_Androiddesignsupport - Fatal编程技术网

Android 应用程序:collapsedTitleGravity=";中心“;不';我不能正常工作

Android 应用程序:collapsedTitleGravity=";中心“;不';我不能正常工作,android,android-support-library,androiddesignsupport,Android,Android Support Library,Androiddesignsupport,我试图通过collapsedTitleGravity=“center”中的collapsedTitleGravity=“center”将标题折叠到中心,但实际上title不是中心。我在标题和向上按钮 它是问题表单设计支持库吗 有没有办法克服这个问题 我看到一个像我一样的人出现在我的房间里 这是屏幕截图 这是一个可疑的未命名视图 这里是主要活动 <android.support.design.widget.CoordinatorLayout xmlns:android="http://sc

我试图通过
collapsedTitleGravity=“center”
中的
collapsedTitleGravity=“center”
将标题折叠到中心,但实际上
title
不是中心。我在
标题
向上按钮

  • 它是问题表单设计支持库吗
  • 有没有办法克服这个问题
  • 我看到一个像我一样的人出现在我的房间里

    这是屏幕截图

    这是一个可疑的未命名视图

    这里是主要活动

    <android.support.design.widget.CoordinatorLayout 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="match_parent"
        tools:context=".ui.profile.detail.ProfileDetailActivity">
    
        <android.support.design.widget.AppBarLayout
            android:id="@+id/abl_profile"
            android:layout_width="match_parent"
            android:layout_height="200dp"
            android:theme="@style/AppTheme.AppBarOverlay">
    
            <android.support.design.widget.CollapsingToolbarLayout
                android:id="@+id/ctl_profile"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:contentScrim="?attr/colorPrimary"
                android:layout_marginTop="52dp"
                app:expandedTitleMarginStart="16dp"
                app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
                app:collapsedTitleGravity="center_horizontal">
               <android.support.v7.widget.AppCompatImageView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:fitsSystemWindows="true"
                    android:src="@mipmap/ic_launcher"
                    app:layout_collapseMode="parallax"/>
                <android.support.v7.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    app:layout_collapseMode="pin"
                    app:popupTheme="@style/AppTheme.PopupOverlay">
                </android.support.v7.widget.Toolbar>
            </android.support.design.widget.CollapsingToolbarLayout>
    
        </android.support.design.widget.AppBarLayout>
    <include layout="@layout/content_profile" />
    </android.support.design.widget.CoordinatorLayout> 
    
    style.xml

    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"/>
    

    有一个属性
    expandedTitleGravity
    ,可与
    折叠工具栏布局一起使用,以使展开的标题文本居中。将此添加到您的
    折叠工具栏布局中

    app:expandedTitleGravity="bottom|center_horizontal"
    

    有一个属性
    expandedTitleGravity
    ,可与
    折叠工具栏布局一起使用,以使展开的标题文本居中。将此添加到您的
    折叠工具栏布局中

    app:expandedTitleGravity="bottom|center_horizontal"
    

    这将解决问题

    android:contentInsetStart=“0dp” android:contentInsetLeft=“0dp” 应用程序:contentInsetLeft=“0dp” 应用程序:contentInsetStart=“0dp”


    保留了填充,以便标题不在工具栏图标旁边

    这将解决问题

    android:contentInsetStart=“0dp” android:contentInsetLeft=“0dp” 应用程序:contentInsetLeft=“0dp” 应用程序:contentInsetStart=“0dp”


    保留了填充,以便标题不在工具栏图标旁边

    我不是说扩大标题。问题是关于崩溃的国家标题,这不是中心。我不是说扩大标题。问题在于正在折叠非中心的状态标题。请尝试此解决方案:尝试此解决方案: