Error: Expected resource of type styleable [ResourceType] error

前端 未结 4 536
一向
一向 2020-12-29 20:57

Take a look at this code snippet. I am getting an error with the last line, because I am passing an \'index\' instead of a resource. I thought it was a lint issue and tried

4条回答
  •  一生所求
    2020-12-29 21:54

    TypedValue outValue = new TypedValue();
    context.getTheme().resolveAttribute(android.R.attr.paddingLeft, outValue, true);
    int paddingLeft = outValue.data;
    

    Repeat the same for android.R.attr.paddingRight

提交回复
热议问题