我对Android开发非常新手,正在探索谷歌网站上的示例代码。我目前使用的代码是SwipeRefreshLayout:http://developer.android.com/samples/SwipeRefreshLayoutBasic/index.html
在这段代码中,我们看到SwipeRefreshLayout被用于一个列表视图,换句话说,如果你向下拖动列表视图,该方法将被触发,列表视图将自动刷新。
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swiperefresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
我感到困惑的是当你向下拖动ListView时,在顶部显示的进度动画条在代码中没有布局。你认为SwipeRefreshLayout会自动生成进度动画条,而不需要用户在xml中指定任何布局吗?
例如,如果想在进度动画条的两端放置填充,以便在刷新时动画不触摸屏幕的两端,该怎么办? https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html并没有提到这方面的内容。
SwipeRefreshLayout.java
文件。您需要安иӘ…ж”ҮжЊЃv4еғ“зљ„жњЂж–°дү®и®ұ版пә€rev 19.1.0пә‰зљ„жғђд»Әз ЃгЂ‚ - Gil Vegliach