折叠的工具栏标题重力未设置为底部

时间:2019-07-31 05:28:27

标签: android android-collapsingtoolbarlayout

我只在这里使用折叠式工具栏和工具栏 是为工具栏使用默认的parallex功能,但是我面临的问题是,后箭头和扩展形式的标题彼此重叠,我试图将Expandedtitlegravity设置为底部也不起作用

        <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="140dp"
        android:background="@color/white"
        android:fitsSystemWindows="true">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/header"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/white"
            android:fitsSystemWindows="true"
            app:collapsedTitleTextAppearance="@style/SavedCollapsedAppBar"
            app:contentScrim="?attr/colorPrimary"
            app:expandedTitleMarginEnd="20dp"
            app:expandedTitleMarginStart="20dp"
             app:expandedTitleTextAppearance="@style/SavedExpandedAppBar"
            app:layout_scrollFlags="scroll|exitUntilCollapsed|enterAlways">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="@color/white"
                android:fontFamily="sans-serif-medium"
                android:theme="@style/SavedToolbarColoredBackArrow"
                app:layout_collapseMode="pin"
                app:popupTheme="@style/AppTheme"
                    app:titleTextAppearance="@style/SavedCollapsedAppBar"
                app:titleTextColor="@color/black" />
           </android.support.design.widget.CollapsingToolbarLayout>

         </android.support.design.widget.AppBarLayout>

1 个答案:

答案 0 :(得分:1)

问题似乎出在fileChangedHandler = (event) => { const {files} = this.state this.setState({ files: [...files, ...event.target.files] }) const uploaders = files.map(file=>{ let data = new FormData() data.append('image',file) return axios.post('/web/v1.0/upload',data,{ onUploadProgress: function (progressEvent) { console.log(Math.floor((progressEvent.loaded * 100) / progressEvent.total));} }).then(response=>{ console.log(response.data) }).catch(error=>{ console.log(error.response.data) }) }) axios.all(uploaders).then(() => { console.log("All images uploaded") }); } 上。

Toolbar中设置app:contentInsetStart,即

Toolbar

它可以解决问题。