Deprecated singleLine attribute bug detected!
When see the deprecated warnings shown on
singleLine attribute as below, sometimes feel like there’s no harm using it.
android:singleLine is deprecated: Use maxLines="1" insteaad
maxLines is not a complete replacement of
singleLine. Check out
I recently used TextInputEditText and I got lint error that singleLine attribute is Deprecated <android.support…stackoverflow.com
I have a style as below <style name="PennyTextSingleLine"> <item name="android:textSize">@dimen…stackoverflow.com
Besides, there’s lots of debate on it, check out
I think the answer to your question is already in one of the SO posts you linked to. Unfortunately, the deprecation of…stackoverflow.com
Using is for a while, didn’t find any issue.
Today, I discovered, a bug caused by
singleLine="1" that exhibit in https://github.com/elye/issue_singleline_animation
It’s basically using
animateLayoutChanges to animate the layout change when add or remove a view from a LinearLayout. While that is happening, it change a text of a TextView (where the width is changed as well).
Check out the OK changed to Normal that loose out the N and part of the o.
By changing the
maxLines="1" in the
MyStyle in style.xml file, the result is now okay.