Android 折叠RTL语言的工具栏标题填充
对于Android 折叠RTL语言的工具栏标题填充,android,android-collapsingtoolbarlayout,Android,Android Collapsingtoolbarlayout,对于RTL语言,如何在collasingtoolbar标题中添加一些填充,这对LTRlaguages很有好处,但对于RTL则像下面一样 非常感谢 这是我的布局。正如你们在上图右侧看到的那个样,标题并没有任何填充。一种方法是在标题前添加更多的空格,但这不是一种明智的方法 <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
RTL
语言,如何在collasingtoolbar
标题中添加一些填充,这对LTR
laguages很有好处,但对于RTL
则像下面一样
非常感谢
这是我的布局。正如你们在上图右侧看到的那个样,标题并没有任何填充。一种方法是在标题前添加更多的空格,但这不是一种明智的方法
<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:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:layout_marginTop="?attr/actionBarSize" />
<android.support.design.widget.TabLayout
android:id="@+id/detail_tabs"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="bottom"
android:background="?attr/colorPrimary"
app:layout_anchor="@+id/appbar"
app:layout_anchorGravity="bottom"
app:tabGravity="fill"
android:layoutDirection="rtl"
app:tabMode="scrollable" />
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="256dp"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="@+id/backdrop"
android:transitionName="profile"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
android:contentDescription="" />
<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/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
app:layout_anchor="@id/appbar"
app:layout_anchorGravity="bottom|left"
android:src="@drawable/ic_arrow_back_black_24dp"
android:layout_margin="@dimen/fab_margin"
android:clickable="true"/>
</android.support.design.widget.CoordinatorLayout>
SDK上肯定有问题 试用
android:titleMarginEnd="0dp"
或
在工具栏上
这将不是完美的,但至少它不会走得更远,比屏幕的结束。我尝试的其他价值观似乎都不起作用
app:titleMarginEnd="0dp"