Android.HowToDefineCustomView
Custom View
Errors
E1 在使用自定义CustomView时,出现以下runtime error:
Android.View.InflateException: Binary XML File Line #LineNumber
Solution: 自定义的View 子类(例如,类名为: FixedImageView)需要实现以下构造方法:
public FixedImageView(Context context);
public FixedImageView(Context context, AttributeSet attrs);
public FixedImageView(Context context, AttributeSet attrs, int defStyle);
如果没有实现以上方法就会出现该Error。
Refereces
1. Custom Components
http://developer.android.com/guide/topics/ui/custom-components.html
2. Creating Custom Views
http://developer.android.com/training/custom-views/index.html
---