当前位置:   article > 正文

Android UI-ListView底部其他控件显示的小例子_listview下拉到底部显示 其他组件view

listview下拉到底部显示 其他组件view

  布局文件中放入ListView之后,在底部加其他控件正常情况会不显示,试出来个小例子,记录一下。

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:orientation="vertical"
  4. android:layout_width="match_parent"
  5. android:layout_height="match_parent"
  6. >
  7. <RelativeLayout
  8. android:id="@+id/ll_head"
  9. android:layout_weight="0.8"
  10. android:layout_width="match_parent"
  11. android:layout_height="wrap_content"
  12. >
  13. <ImageView
  14. android:id="@+id/iv_me"
  15. android:layout_width="wrap_content"
  16. android:layout_height="wrap_content"
  17. android:src="@drawable/ic_launcher"
  18. />
  19. <TextView
  20. android:id="@+id/tv_introduce"
  21. android:paddingTop="0dp"
  22. android:layout_width="wrap_content"
  23. android:layout_height="wrap_content"
  24. android:text="推荐"
  25. android:textSize="30dp"
  26. android:layout_centerHorizontal="true"
  27. />
  28. <ImageView
  29. android:id="@+id/iv_add"
  30. android:layout_width="wrap_content"
  31. android:layout_height="wrap_content"
  32. android:src="@drawable/ic_launcher"
  33. android:layout_alignParentRight="true"
  34. />
  35. </RelativeLayout>
  36. <ListView
  37. android:id="@+id/lv_content"
  38. android:layout_marginTop="10.0dip"
  39. android:layout_weight="10"
  40. android:layout_width="match_parent"
  41. android:layout_height="wrap_content"
  42. android:paddingBottom="20dp"
  43. >
  44. </ListView>
  45. <RelativeLayout
  46. android:id="@+id/ll_foot"
  47. android:layout_weight="0.8"
  48. android:layout_width="match_parent"
  49. android:layout_height="wrap_content"
  50. >
  51. <Button
  52. android:id="@+id/btn_joke"
  53. android:layout_width="wrap_content"
  54. android:layout_height="wrap_content"
  55. android:drawableTop="@drawable/ic_launcher"
  56. android:text="段子"
  57. />
  58. <Button
  59. android:id="@+id/btn_pic"
  60. android:layout_width="wrap_content"
  61. android:layout_height="wrap_content"
  62. android:layout_toRightOf="@id/btn_joke"
  63. android:drawableTop="@drawable/ic_launcher"
  64. android:text="图片"
  65. />
  66. <Button
  67. android:id="@+id/btn_video"
  68. android:layout_width="wrap_content"
  69. android:layout_height="wrap_content"
  70. android:drawableTop="@drawable/ic_launcher"
  71. android:layout_centerHorizontal="true"
  72. android:text="视频"
  73. />
  74. <Button
  75. android:id="@+id/btn_search"
  76. android:layout_width="wrap_content"
  77. android:layout_height="wrap_content"
  78. android:layout_toRightOf="@id/btn_video"
  79. android:drawableTop="@drawable/ic_launcher"
  80. android:text="发现"
  81. />
  82. <Button
  83. android:id="@+id/btn_check"
  84. android:layout_width="wrap_content"
  85. android:layout_height="wrap_content"
  86. android:layout_alignParentRight="true"
  87. android:drawableTop="@drawable/ic_launcher"
  88. android:text="审核"
  89. />
  90. </RelativeLayout>
  91. </LinearLayout>
其他在底部加控件的参考网页:

http://www.cnblogs.com/loulijun/archive/2012/10/25/2738952.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/312559?site
推荐阅读
相关标签
  

闽ICP备14008679号