私はバグをオープンしましたが、誰かがこの問題に遭遇し、回避策を知っているかどうか疑問に思っていました. 内部にヒントを含むテキスト ビューを定義する場合は、正しい重力 (android:gravity="right") を指定してから、android:singleLine=true または android:maxLines="1" または android:scrollHorizonatally="true" を定義する場合ヒントは表示されません。右の重力を削除すると、ヒントが左側に戻り、上記のすべてのツリー パラメータを削除すると、ヒントが右側に配置されます。右側にヒントが欲しいのですが、水平線が 1 本必要です...
ヒントを表示しないサンプル レイアウトを次に示します。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dp">
<EditText android:layout_width="fill_parent"
android:layout_gravity="center_vertical|right"
android:layout_height="wrap_content"
android:layout_margin="6dp"
android:textSize="16sp"
android:paddingRight="5dp"
android:id="@+id/c"
android:gravity="right"
android:hint="hello!!!"
android:scrollHorizontally="true"
android:maxLines="1"
android:singleLine="true"/>
</LinearLayout>
1.6 および 2.1 エミュレーターでチェックしたところ、100% 再現されました。これはバグだと確信しています。1 行とヒントの間の接続がわかりません。 mLayout と mHintLayout の両方が存在し、テキストの長さが 0 の場合は onDraw にあり、mHint が null でない場合は mHintLayout が使用されます)。