1

操作欄下拉刷新在以下情況下的Android chrisbanes操作欄下拉以刷新嵌套佈局不工作

<?xml version="1.0" encoding="utf-8"?> 
<uk.co.senab.actionbarpulltorefresh.extras.actionbarsherlock.PullToRefreshLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/ptr_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" > 

     <LinearLayout 
      android:id="@+id/top_btns_layout" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentTop="true" 
      android:orientation="horizontal" > 

      <Button 
       android:id="@+id/allstores_button" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_weight="1" 
       android:text="all" /> 

      <Button 
       android:id="@+id/stores_nearme_button" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_weight="1" 
       android:text="near me" /> 

      <Button 
       android:id="@+id/stores_ifallow_button" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_weight="1" 
       android:text="dfdf" /> 
     </LinearLayout> 

     <ListView 
      android:id="@+id/store_listView1" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_below="@+id/top_btns_layout" 
      android:background="#ddd" 
      android:cacheColorHint="#00000000" 
      android:divider="@null" 
      android:dividerHeight="8dp" 
      android:visibility="visible" > 
     </ListView> 
    </RelativeLayout> 

我使用這個庫福爾摩斯庫不工作,我也是使用actionbarsherlock

lib。我不知道如何使用AbsPullToRefreshAttacher這是使用添加自定義視圖

拉刷新,可以任何人請幫助我。提前感謝。

+0

'這個庫'在哪裏? – keshav

+0

它的Chrisbanes Actionbar-PulltoRefresh lib:https://github.com/chrisbanes/ActionBar-PullToRefresh – GangaNaidu

+0

爲什麼不嘗試https://github.com/chrisbanes/Android-PullToRefresh。 – keshav

回答

0

支持的瀏覽 的動作條,PullToRefresh已經內置支持:

AbsListView衍生物(ListView控件& GridView控件) 滾動型 的WebView

所以你的情況只是sorround你的RelativeLayout和帶有ScrollView的ListView。

如果你不喜歡這個解決方案,你必須閱讀文檔=/