任何人都可以幫助我嗎?無法在listView中上傳,因爲SwipeRefreshLayout
我在一個RelativeLayout中有一個ListView,它是SwipeRefreshLayout的子節點。這是一個片段的視圖。
這裏是一張圖片的佈局,這個截圖是在我處於ListView底部的時候拍攝的,所以當我嘗試上去的時候,我還加載了SwipeRefresh,而且很難去到ListView的頂部。
我曾嘗試類似於在RelativeLayout之前和SwipeRefreshLayout之後包含ScrollView併成功。滾動工作良好,但它只能工作,如果我擴展listView到2400 DP和我沒有得到好的看法。我有一些空的ListView的底部,這不是我想要的。
因此,如果任何人有任何建議,我可以做什麼,讓我知道。
下面是XML代碼:
<?xml version="1.0" encoding="utf-8"?>
<!-- This is the fragment to be displayed for a section associated with a tab -->
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/layout_round_rect_shape" >
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@color/list_divider"
android:dividerHeight="1dp"
android:listSelector="@drawable/lista_preporuka_selector" >
</ListView>
</RelativeLayout>
</android.support.v4.widget.SwipeRefreshLayout>
我可以確認,你的建議的工作。每當我被迫有一個不是'SwipeRefreshLayout'的直接子類的'ListView'時,我採取了同樣的方法。 –