在我的應用程序中我有固定大小的編輯文本,但提示大小超過編輯文本,所以提示不完全顯示。我想通過水平滾動完全顯示提示,但我沒有任何想法如何做到這一點。在編輯文本提示需要水平滾動
如果減小提示字體的大小,它將有所幫助,但我不想減小字體大小。
以下是我使用的示例代碼。
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:singleLine="true"
android:id="@+id/test_etx"
android:hint="@string/hint"
android:layout_below="@+id/bt3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="29dp"
android:layout_alignRight="@+id/etx"
android:layout_alignEnd="@+id/etx"
android:maxLength="10"
/>
嘗試添加'android:scrollbars =「horizontal」'。 –
它不起作用 – YBDevi
或者您可以將edittext包裝在水平滾動視圖中。 –