你好,游客 登录 注册 搜索
背景:
阅读新闻

Android中实现下拉刷新

[日期:2012-11-19] 来源:Linux社区  作者:Linux [字体:大 中 小]

2.msgrcvlistactivity.xml:

  1. <?xmlversion="1.0"encoding="utf-8"?>
  2. <RelativeLayout
  3. xmlns:Android="http://schemas.android.com/apk/res/android"
  4. android:layout_width="fill_parent"
  5. android:layout_height="fill_parent"
  6. >
  7. <LinearLayoutandroid:orientation="vertical"
  8. android:layout_width="fill_parent"
  9. android:layout_height="fill_parent"
  10. android:background="#000000">
  11. //将ListView改为包名.自定义的列表类名,MsgListView.java代码见后,此代码不需改通用,下拉刷新相关即此处,其他无关
  12. <cn.xd.microblogging.tools.MsgListView
  13. android:id="@android:id/list"
  14. android:layout_height="wrap_content"
  15. android:layout_width="fill_parent"
  16. android:layout_weight="1.0"
  17. android:drawSelectorOnTop="false"
  18. android:scrollbars="vertical"
  19. android:fadingEdgeLength="0dip"
  20. android:divider="@drawable/line"
  21. android:dividerHeight="3.0dip"
  22. android:cacheColorHint="#00000000"
  23. android:paddingBottom="40dp"/>
  24. </LinearLayout>
  25. <LinearLayout
  26. android:id="@+id/msg_list_load"
  27. android:layout_width="fill_parent"
  28. android:layout_height="fill_parent">
  29. <LinearLayoutandroid:id="@android:id/empty"
  30. android:layout_width="fill_parent"
  31. android:layout_height="fill_parent">
  32. <include
  33. android:id="@android:id/empty"
  34. layout="@layout/empty_loading"
  35. android:layout_width="fill_parent"
  36. android:layout_height="fill_parent"/>
  37. </LinearLayout>
  38. </LinearLayout>
  39. </RelativeLayout>

 

  1. <?xmlversion="1.0"encoding="utf-8"?>
  2. <RelativeLayout
  3. xmlns:android="http://schemas.android.com/apk/res/android"
  4. android:layout_width="fill_parent"
  5. android:layout_height="fill_parent"
  6. >
  7. <LinearLayoutandroid:orientation="vertical"
  8. android:layout_width="fill_parent"
  9. android:layout_height="fill_parent"
  10. android:background="#000000">
  11. //将ListView改为包名.自定义的列表类名,MsgListView.java代码见后,此代码不需改通用,下拉刷新相关即此处,其他无关
  12. <cn.xd.microblogging.tools.MsgListView
  13. android:id="@android:id/list"
  14. android:layout_height="wrap_content"
  15. android:layout_width="fill_parent"
  16. android:layout_weight="1.0"
  17. android:drawSelectorOnTop="false"
  18. android:scrollbars="vertical"
  19. android:fadingEdgeLength="0dip"
  20. android:divider="@drawable/line"
  21. android:dividerHeight="3.0dip"
  22. android:cacheColorHint="#00000000"
  23. android:paddingBottom="40dp"/>
  24. </LinearLayout>
  25. <LinearLayout
  26. android:id="@+id/msg_list_load"
  27. android:layout_width="fill_parent"
  28. android:layout_height="fill_parent">
  29. <LinearLayoutandroid:id="@android:id/empty"
  30. android:layout_width="fill_parent"
  31. android:layout_height="fill_parent">
  32. <include
  33. android:id="@android:id/empty"
  34. layout="@layout/empty_loading"
  35. android:layout_width="fill_parent"
  36. android:layout_height="fill_parent"/>
  37. </LinearLayout>
  38. </LinearLayout>
  39. </RelativeLayout>
linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款