0
내 앱용 사용자 정의 툴바를 만들었습니다. 하지만 내 안드로이드 4.4 KitKat 장치에서 나에게 아직 알려지지 않은 이유가 있기 때문에 수직 중심의 텍스트가 올바르게 가운데에 있지 않습니다. 모든 안드로이드 5 이상의 장치에서 잘 작동합니다.Android 사용자 정의 툴바 제목 텍스트가 Android 4.4 디바이스를 중심으로하지 않습니다.
textView의 텍스트가 중앙 대신 4.4에서 아래처럼 보이는 것은 툴바의 중심으로 정렬됩니다.
누구나 어떻게 해결할 수 있을까요? 다음 경우 XML로
당신이보고 싶습니다 :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/toolbar_root"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
tools:background="@color/background_default">
<LinearLayout
android:id="@+id/toolbar_icon_left_container"
android:layout_width="48dp"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:background="?selectableItemBackgroundBorderless"
android:clickable="true">
<ImageView
android:id="@+id/toolbar_icon_left_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/back"/>
</LinearLayout>
<TextView
android:id="@+id/toolbar_title"
android:fontFamily="@font/museo700"
android:singleLine="true"
android:layout_toRightOf="@+id/toolbar_icon_left_container"
android:layout_toLeftOf="@+id/toolbar_text_right"
style="@style/TextStyle5"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toEndOf="@+id/toolbar_icon_left_container"
android:gravity="center_vertical"
tools:text="Selecteer een leverdatum"/>
<TextView
android:id="@+id/toolbar_text_right"
style="@style/TextStyle7"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/screen_edge_margin"
android:background="?selectableItemBackgroundBorderless"
android:clickable="true"
android:gravity="right|center_vertical"
android:minWidth="48dp"
tools:gravity="right|center_vertical"
tools:text="Help"/>