int iconwidth = Math.min()这句怎么会包空指针啊
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int iconwidth = Math.min(getMeasuredWidth() - getPaddingLeft()
, getMeasuredHeight() - getPaddingTop()
- getPaddingBottom() - mTextBound.height());
int left=getMeasuredWidth()/2-iconwidth/2;
int top=getMeasuredHeight()/2-(mTextBound.height() + iconwidth)/2;
mIconRect=new Rect(left,top,left+iconwidth,top+iconwidth);
}
可是我的代码没有错啊