I've added an EditText
to my layout, and added a hint, and made it centered horizontally.
When running the application, the hint was invisible. I found that I should make ellipsize
value of the TextView
to be start
:
<EditText
android:id="@+id/number1EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="start"
android:ems="10"
android:gravity="center_horizontal"
android:hint="@string/hint1" />
In Android documentation, I read:
If set, causes words that are longer than the view is wide to be
ellipsized instead of broken in the middle.
The problem is that ellipsize
is not found in the dictionary. Can anybody explain to me what benefits we can gain by ellipsize
attribute? And what is the difference between start
, end
, middle
?
You can find documentation here.
Based on your requirement you can try according option.
to ellipsize, a neologism, means to shorten text using an ellipsis, i.e. three dots ...
or more commonly ligature …
, to stand in for the omitted bits.
Say original value pf text view is aaabbbccc and its fitting inside the view
start
's output will be : ...bccc
end
's output will be : aaab...
middle
's output will be : aa...cc
marquee
's output will be : aaabbbccc auto sliding from right to left