創(chuàng)建自定義view的時候,碰到 android.view.InflateException: Binary XML file line #異常,反復(fù)研究后發(fā)現(xiàn)是缺少一個構(gòu)造器造成。
public MyView(Context context,AttributeSet paramAttributeSet)
{
super(context,paramAttributeSet);
}
補(bǔ)齊這個構(gòu)造器,異常就消失了,如果碰到這個問題不妨試試看。