Recently saw a colleague wrote a piece of code, very easy it is:
<linearlayout android:layout_width= "wrap_content" android:layout_height= "Wrap_content" android: Layout_centervertical= "true" android:orientation= "horizontal" android:gravity= "center_vertical" > <textview android:layout_width= "wrap_content" android:layout_height= "Wrap_content" Android : hint= "XXXXX" android:text= "x" /> <textview android:layout_width= "Wrap_content" android:layout_height= "Wrap_content" android:textsize= "16sp" android:text= "(x)" /> < /linearlayout>
The effects shown are as follows:
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvemhvdwrhawxpyw5n/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">
Yes, the effect is this, two x has a very large gap between the beginning I thought it was a colleague set what, and later looked at the XML did not see anything. Think of is set MinWidth, but also did not see, the key is to show the effect has a minimum length, find a half-day, finally realize hint this property, set the Hint property, the corresponding TextView the minimum width will be related to the length of the text you set, This is the last reason for this problem, and to this, I want to say the end of ...
The effect of Android:hint property on TextView