EditText 的提示被切断,因为我的提示文本超过一行。editText 只显示一行。我怎样才能使整个提示可见?

use*_*911 5 xml android android-edittext

EditText 的提示被切断,因为我的提示文本超过一行。editText 只显示一行。我怎样才能使整个提示可见?

这是给我带来麻烦的editText。

<EditText android:id="@+id/pin" 
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:inputType="number"
         android:hint="@string/pinhintadmin"
         android:maxLength="4"
         android:layout_margin="10dip"
         android:layout_marginBottom="20dip"/>
Run Code Online (Sandbox Code Playgroud)

这是我的整个 xml 文件。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@drawable/background1" >  
    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >
        <LinearLayout 
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" > 

            <TextView android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:text="@string/burr"
         android:textStyle="bold"
         android:layout_marginLeft="10dip"
         android:layout_marginRight="10dip"
         android:layout_marginTop="20dip"/>

    <EditText android:id="@+id/flob" 
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:hint="@string/buildingnameandaddress"
         android:inputType="textCapWords"
         android:layout_margin="10dip"
         android:layout_marginBottom="20dip"/>


     <TextView android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:text="@string/appartment"
         android:textStyle="bold"
         android:layout_marginLeft="10dip"
         android:layout_marginRight="10dip"
         android:layout_marginTop="20dip"/>

     <EditText android:id="@+id/txtName" 
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:hint="@string/hintapp"
         android:layout_margin="10dip"
         android:inputType="textCapSentences"
         android:layout_marginBottom="20dip"/>
     <TextView android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:text="Pin:"
         android:textStyle="bold"
         android:layout_marginLeft="10dip"
         android:layout_marginRight="10dip"
         android:layout_marginTop="20dip"/>

     <EditText android:id="@+id/pin" 
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:inputType="number"
         android:hint="@string/pinhintadmin"
         android:maxLength="4"
         android:layout_margin="10dip"
         android:layout_marginBottom="20dip"/>

     <TextView android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:text="@string/username"
         android:textStyle="bold"
         android:layout_marginLeft="10dip"
         android:layout_marginRight="10dip"/>

     <EditText android:id="@+id/txtEmail" 
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:inputType="textCapWords"
         android:layout_margin="10dip"
         android:layout_marginBottom="20dip"/>
     <TextView android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:text="@string/password"
         android:textStyle="bold"
         android:layout_marginLeft="10dip"
         android:layout_marginRight="10dip"
         android:layout_marginTop="20dip"/>

     <EditText android:id="@+id/registerPassword" 
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:layout_margin="10dip"
         android:layout_marginBottom="20dip"/>
      <Button
        android:id="@+id/btnRegister"
        android:text="@string/registerbtnadmin"
       android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dip"
        android:textStyle="bold" 
        android:background="@drawable/button_red"
         android:textColor="@drawable/button_text_color" />

     <!--  Error message -->
        <TextView android:id="@+id/register_error"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:textColor="#e30000"
                    android:padding="10dip"
                    android:textStyle="bold"/>
     </LinearLayout>
     </ScrollView>

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

小智 2

你可以试试

android:scrollHorizontally="true"
Run Code Online (Sandbox Code Playgroud)

如此处所引用

或者你可以尝试这个

view.setHint(Html.fromHtml("<small><small><small>" + 
         getString(R.string.hint) + "</small></small></small>"));
Run Code Online (Sandbox Code Playgroud)

作为此处接受的答案