定义float资源java
<resources> <item name="shop_gift_scale" format="float" type="dimen">1.5</item> </resources>
获取float资源code
TypedValue tv = new TypedValue(); getResources().getValue(R.dimen.shop_gift_scale, tv, true); tv.getFloat();
定义int资源orm
<resources> <integer name="int1">1</integer> </resources>
获取int资源xml
int inte = getResources().getInteger(R.integer.int1);