问题描述
我在项目(很棒的库)中使用CountryCodePickerProject。它允许为该号码设置电话号码前缀。我编写了以下布局:
<LinearLayout
android:id="@+id/login_phone_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<ImageView
android:id="@+id/login_phone_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_lock_black_24dp"
android:layout_marginRight="5dp"
android:layout_marginEnd="5dp"
app:tint="@color/lightGrayColor" />
<com.hbb20.CountryCodePicker
android:id="@+id/login_phone_ccp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:ccp_defaultNameCode="IL"
app:ccp_autoDetectLanguage="true" />
<EditText
android:id="@+id/login_phone_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="phone"
android:hint="Phone number"
android:autofillHints="Phone number" />
</LinearLayout>
它基本上会创建以下显示:
[图标] [国家/地区前缀] [要填写的电话号码]
在LTR语言中,它看起来很棒。但是,当我将电话的语言更改为RTL时,它会显示:
[Phone number Box to fill] [Country Prefix] [icon]
这看起来很奇怪,因为前缀应该在电话号码的左侧(即使在RTL中也是如此)。说到UI / UX思维,这里显示RTL的最佳解决方案是什么,这样看起来就不会尴尬?也许强迫它在左边?但随后您将看到类似+11 [________ملحوظة]
的内容。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)