I was wondering if it is possible to somehow set TextView
s with a given Theme to have a Spannable.Factory
-instance without having to manually declare:
- a new type of
TextView
(one which extendsTextView
and in the constructor somewhere overriding the factory) - or set it on every instance of
TextView
after inflating it.
Ideally it would be nice to have something like
<TextView
android:spannableFactory="com.mypackage.Class"
/>
Worst case is that it makes a new开发者_如何学JAVA instance of the class each time, but even that is more desirable than having to explicitly deal with setting the factory every time.
精彩评论