日々精進

新しく学んだことを書き留めていきます

2015-01-02から1日間の記事一覧

CustomViewをlayout xmlで使うと「Binary XML file line # : Error inflating class」エラー

原因はコンストラクタが足りないこと。 下記のコンストラクタは必ず定義しないといけない。 public CustomView(Context context){ super(context); } public CustomView(Context context,AttributeSet attrs,int defStyle){ super(context,attrs,defStyle); …