Accessing integer resources in xml

前端 未结 6 1464
醉酒成梦
醉酒成梦 2021-02-02 08:23

I have read this where found that how to access integer resources in java class but no docs for another resource.

Here is Resources at res/values/integers.xml

         


        
6条回答
  •  猫巷女王i
    2021-02-02 08:56

    Also You Can Define It This Way :

    
    10
    
    

    Format = enclosing data type:

    float boolean fraction integer ... and type stands for:

    Type = resource type (referenced with R.XXXXX.name):

    color dimen string style etc...

    Access It Like This :

    Resources res = getResources();
    int i= res.getInteger(R.dimen.int_value);
    

提交回复
热议问题