android - TypedArray - how to retrieve textStyle from xml (getInteger fails) -
textstyle
integer value, following should work, shouldn't it?
private static final int[] attrs = new int[] { android.r.attr.textsize, android.r.attr.textcolor, android.r.attr.textstyle }; typedarray = context.obtainstyledattributes(attrs, attrs); tabtextsize = a.getdimensionpixelsize(0, tabtextsize); tabtextcolor = a.getcolor(1, tabtextcolor); tabtypefacestyle = a.getinteger(2, tabtypefacestyle); a.recycle();
actually, tabtypefacestyle
has default value...
my layout looks following:
<com.astuetz.viewpager.extensions.pagerslidingtabstrip android:id="@+id/indicator" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textcolor="@color/white" android:textsize="14sp" android:textstyle="normal" app:dividercolor="@color/white" app:dividerpadding="2dp" app:dividerpaddingbottom="8dp" app:indicatorcolor="@color/abs__holo_blue_light" app:indicatorheight="8dp" app:tabpaddingleftright="5dip" app:underlinecolor="@color/abs__holo_blue_light" />
ps: following fails:
typedvalue v = new typedvalue(); boolean s = a.getvalue(2, v);
s
false
....
Comments
Post a Comment