canyinghao / CanRefresh

可适配所有视图的下拉刷新上拉加载,并支持各种风格。
Apache License 2.0
350 stars 82 forks source link

加到布局里初始化时报错 android.view.InflateException: Binary XML file line #44: mContentView is null #15

Open yyy000112 opened 7 years ago

yyy000112 commented 7 years ago

android.view.InflateException: Binary XML file line #44: mContentView is null

我的布局如下 <?xml version="1.0" encoding="utf-8"?> <com.canyinghao.canrefresh.CanRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/canfresh" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">

<RelativeLayout
    android:background="#fff"
    android:layout_width="match_parent"
    android:layout_height="40dp">

    <ImageView
        android:id="@+id/iv_search_brand"
        android:src="@drawable/search_large"
        android:layout_marginLeft="10dp"
        android:layout_centerVertical="true"
        android:layout_width="25dp"
        android:layout_height="25dp" />

    <TextView
        android:layout_centerVertical="true"
        android:layout_centerInParent="true"
        android:text="品牌"
        android:textSize="16sp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</RelativeLayout>

<android.ye.fashioncircle.view.verticalViewPager.VerticalViewPager
    android:id="@+id/vertical_viewpager"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
</android.ye.fashioncircle.view.verticalViewPager.VerticalViewPager>

</com.canyinghao.canrefresh.CanRefreshLayout>

canyinghao commented 7 years ago

你用法错了,参考示例,id必须为can_content_view、can_refresh_header等

yyy000112 commented 7 years ago

更改后点击相应页面无法响应了 Error reporting crash android.os.TransactionTooLargeException: data parcel size 11802176 bytes

canyinghao commented 7 years ago

你参考demo吧,先用listview之类的试,没问题了,再换成你要写的布局。

yyy000112 commented 7 years ago

哎,用不了,添加依赖后,跟我其他的都起冲突了,提示Fragment null must be a public static class to be properly recreated from in

canyinghao commented 7 years ago

这,我也不清是怎么回事,抱歉