定義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);