【发布时间】:2016-05-24 12:16:38
【问题描述】:
我对 RTL 语言中的 android 输入光标有疑问。当我在 RTL 支持布局中时,我有两个输入光标,这真的很有趣。 它有真正的解决方案,摆脱这个吗?
我使用这段代码来制作我的 android UI RTL:
getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
这是我用于文本视图的 xml:
<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:id="@+id/myID"
android:maxLines="1"
android:focusableInTouchMode="true"
android:layout_weight="0.25"
android:layout_gravity="center_horizontal"
android:hint="phone Number"
android:maxLength="20"
android:gravity="center" />
</android.support.design.widget.TextInputLayout>
【问题讨论】:
-
我可能是因为您已将edittext 重力设置为中心并且光标混淆了。这不应该发生,但尝试左右重力然后可能不会出现问题。最好你给重力值开始
-
@CreativeAndroid 我做了你所说的一切,但仍然是同样的问题。
-
发布您的edittext xml
-
@CreativeAndroid 我发了,请查看。谢谢
-
我认为你强行将其设置为 RTL
标签: android layout right-to-left text-cursor