EditText hint doesn't show

前端 未结 10 1734
生来不讨喜
生来不讨喜 2020-12-05 04:23

My EditText configured as follows won\'t show the hint:



        
相关标签:
10条回答
  • 2020-12-05 04:50

    No need of android:scrollHorizontally attribute. Remove it.EditText is a fixed item on the screen. we want scroll the layout contains the EditText is enough. that is the best design too. you have put android:ellipsize="end" instead of android:scrollHorizontally.

    0 讨论(0)
  • 2020-12-05 04:50

    This is how, I did for by EditText to have hint in it.

    <EditText
        android:id="@+id/productQuantity"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="right|center_vertical"
        android:hint="@string/quantity"
        android:inputType="numberSigned"
        android:ellipsize="end"
        android:singleLine="true" >
    </EditText>
    

    Screenshot of what the above code should look like

    0 讨论(0)
  • 2020-12-05 04:56

    using android:ellipsize="end" fixed it for me Weird bug !! (but Android has a lot of these weirdo bug)

    0 讨论(0)
  • 2020-12-05 04:57

    You need to give text color to hint

    android:textColorHint="#000000"
    
    0 讨论(0)
提交回复
热议问题