久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

android - CollapsingToolbarLayout顯示標(biāo)題不全,被截?cái)嗔?/h1>
瀏覽:139日期:2024-08-19 09:52:34

問(wèn)題描述

我正在使用CollapsingToolbarLayout顯示一個(gè)界面,但是當(dāng)CollapsingToolbarLayout展開(kāi)的時(shí)候,標(biāo)題沒(méi)有完全顯示,如下圖:

android - CollapsingToolbarLayout顯示標(biāo)題不全,被截?cái)嗔? src=

我本想顯示“this is a long long title.”,結(jié)果右邊空出了一大段而標(biāo)題卻被截?cái)嗔恕?p>我按照搜索到的各種方法嘗試過(guò)了,比如設(shè)置margin或者padding,都沒(méi)有什么用。

所以我應(yīng)該怎么設(shè)置才能讓標(biāo)題完全顯示??

下面是我的布局文件

<?xml version='1.0' encoding='utf-8'?><android.support.design.widget.CoordinatorLayout android: xmlns:android='http://schemas.android.com/apk/res/android' xmlns:app='http://schemas.android.com/apk/res-auto' android:layout_width='match_parent' android:layout_height='match_parent' android:fitsSystemWindows='true'> <android.support.design.widget.AppBarLayoutandroid:layout_width='match_parent'android:layout_height='240dp'android:fitsSystemWindows='true'><android.support.design.widget.CollapsingToolbarLayout android: android:layout_width='match_parent' android:layout_height='match_parent' android:fitsSystemWindows='true' app:contentScrim='@color/colorPrimary' app:expandedTitleTextAppearance='@style/ExpandedAppBar' app:collapsedTitleTextAppearance='@style/CollapsedAppBar' app:layout_scrollFlags='scroll|exitUntilCollapsed'> <ImageViewandroid: android:layout_width='match_parent'android:layout_height='match_parent'android:fitsSystemWindows='true'android:scaleType='centerCrop'app:layout_collapseMode='parallax'app:layout_collapseParallaxMultiplier='0.7'/> <android.support.v7.widget.Toolbarandroid: app:popupTheme='@style/AppTheme.PopupOverlay'android:theme='@style/ToolBarStyle'android:layout_width='match_parent'app:background='@color/colorPrimary'android:layout_height='?attr/actionBarSize'app:layout_collapseMode='pin'> </android.support.v7.widget.Toolbar></android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout> <android.support.v4.widget.NestedScrollViewandroid: android:layout_width='match_parent'android:layout_height='match_parent'app:layout_behavior='@string/appbar_scrolling_view_behavior'><WebView android: android:layout_width='match_parent' android:layout_height='match_parent'></WebView> </android.support.v4.widget.NestedScrollView></android.support.design.widget.CoordinatorLayout>

問(wèn)題解答

回答1:

這個(gè)東西本來(lái)就沒(méi)這么長(zhǎng),之所以靠右有那么多空間,是因?yàn)樗梢栽O(shè)置gravity屬性。如果確實(shí)有必要使用長(zhǎng)title,可以看下這個(gè)項(xiàng)目:multiline-collapsingtoolbar

回答2:

調(diào)一下textappearance試試?

主站蜘蛛池模板: 英吉沙县| 嵊州市| 慈溪市| 喀喇| 齐齐哈尔市| 图木舒克市| 凉城县| 平泉县| 楚雄市| 郁南县| 韶山市| 乌审旗| 冷水江市| 砀山县| 喜德县| 丹东市| 石渠县| 曲阳县| 吉安县| 新龙县| 阿勒泰市| 沭阳县| 丰县| 新建县| 吉安县| 周宁县| 胶州市| 新乡市| 定陶县| 三明市| 吉安县| 陵水| 日喀则市| 桂阳县| 新兴县| 通化市| 贺兰县| 百色市| 扎赉特旗| 拜城县| 新泰市|