0
我花了很多时间在尝试解决这个问题,但没有成功,现在...的Android的EditText密码,标签gravitiy RTL
当应用程序与RTL语言运行Android。 EditText的标签(提示)显示在错误的位置。
期望的结果 ltr layout
RTL布局 rtl layou
XML
<?xml version="1.0" encoding="utf-8"?>
<android.support.percent.PercentRelativeLayout
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">
<!-- Login form container -->
<android.support.percent.PercentRelativeLayout
android:id="@+id/form_container"
android:layout_centerHorizontal="true"
app:layout_widthPercent="85%"
app:layout_heightPercent="30%"
app:layout_marginTopPercent="8%">
<!-- Username layout -->
<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout_username"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/input_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:inputType="textVisiblePassword|textNoSuggestions"
android:textDirection="ltr"
android:hint="@string/hint_username"/>
</android.support.design.widget.TextInputLayout>
<!-- Password layout -->
<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_below="@+id/input_layout_username">
<EditText
android:id="@+id/input_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:textDirection="anyRtl"
android:hint="@string/hint_password"
android:inputType="textPassword" />
</android.support.design.widget.TextInputLayout>
</android.support.percent.PercentRelativeLayout>
</android.support.percent.PercentRelativeLayout>
如何解决在RTL布局中不需要的边缘? 另外,如果可以移除/隐藏“可见性切换”(眼睛图标)按钮,那将会很棒!
谢谢!
请发表您的XML代码 –
我忘了附上的XML代码,遗憾的是.. 。 谢谢! – HugaBuga