原因一:
必须实现三个构造函数:public GalleryFlow(Context context) {
super(context);
}
public GalleryFlow(Context context, AttributeSet attrs) {
super(context, attrs);
}
public GalleryFlow(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
原因二:
或者XML中包错!<com.yourpackege.yourLayout
android:id="@+id/name"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/transparent"/>