attr和styleable之间有什么区别?

时间:2015-04-30 02:44:16

标签: android android-resources attr

/*int widthWeight = attrs.getAttributeIntValue(R.attr.ratio_width_weight,0);
    int heightWeight = attrs.getAttributeIntValue(R.attr.ratio_height_weight,0);*/

    TypedArray a = context.obtainStyledAttributes(attrs,R.styleable.RatioImageView);
    int widthWeight = a.getInt(R.styleable.RatioImageView_ratio_width_weight,0);
    int heightWeight = a.getInt(R.styleable.RatioImageView_ratio_height_weight,0);

“attrs.getAttributeIntValue”未返回预期值。

0 个答案:

没有答案