I have a simple Button
:
<Button
android:id="@+id/test"
android:textColor="@color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
and try to change text property by:
SpannableString span = new SpannableString(text);
span.setSpan(new AbsoluteSizeSpan(8, true), 5, 10, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
testButton.setText(span);
It works on Android 4.3 but doesn't on 5.0.
The interesting thing is when I change implementation from Button
to TextView
it works fine on 5.0. Seems to be something with Button
in Lollipop.
AbsoluteSizeSpan
is lost, that does not shock me, as Android 5.0 seems to want to control the captions more, such as forcing them to all caps. – ExsertAbsoluteSizeSpan
to continue working. – Exsert