LinearLayout上的SwipeRefreshLayout?

时间:2015-08-26 08:33:52

标签: android swiperefreshlayout

SwipeRefreshLayout上,LinearLayout工作正常。但是,仅在ListView(没有SwiperefreshLayout's)时,行为就很奇怪了。 import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.nio.CharBuffer; public class Main { public static void main(String... args) { try (FileReader fr = new FileReader("a.txt")) { try (BufferedReader reader = new BufferedReader(fr)) { CharBuffer charBuffer = CharBuffer.allocate(8192); reader.read(charBuffer); } catch (IOException e) { e.printStackTrace(); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } 进度条没有完全显示,事实上,它只显示了几分之一秒。问题是什么?

1 个答案:

答案 0 :(得分:30)

LinearLayout内的SwipeRefreshLayout内,设置 android:clickable="true"

<LinearLayout
        android:id="@+id/dummy_view"
        android:clickable="true"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">