SmartRefreshLayout 启动闪退

2019-02-28  本文已影响0人  令狐达耶

异常提示SmartRefreshLayout无法初始化,是官方例子太精简
我使用的版本


implementation'com.scwang.smartrefresh:SmartRefreshLayout:1.0.5.1'

implementation'com.scwang.smartrefresh:SmartRefreshHeader:1.0.5.1'

Layout作了改动,再启动就没有问题

<?xml version="1.0" encoding="utf-8"?>
<com.scwang.smartrefresh.layout.SmartRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
app:srlAccentColor="#27C5FF"
app:srlEnablePreviewInEditMode="true"
app:srlPrimaryColor="@android:color/white">
<!--srlAccentColor srlPrimaryColor 将会改变 Header 和 Footer 的主题颜色-->
<!--srlEnablePreviewInEditMode 可以开启和关闭预览功能-->

<ListView
    android:id="@+id/listView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="2dp"
    android:divider="#00000000"
    android:gravity="fill"
    android:listSelector="#00000000"
    android:numColumns="1"
    android:scrollbars="none"
    android:stretchMode="columnWidth" />

</com.scwang.smartrefresh.layout.SmartRefreshLayout>
上一篇 下一篇

猜你喜欢

热点阅读