2024年3月9日发(作者:)
Android模仿QQ的左右滑动切换界面和下拉更新的效果
因为功能还没有完全实现,所以效果不是太好,不过呢,还是能实现,左右滑动时候切换界
面和显示QQ好友列表的简单功能!!好了,废话不多说了看看实现的过程吧!
1.首先看看布局
主布局
1.
2. 3. android:layout_width="fill_parent" 4. android:layout_height="fill_parent" 5. android:orientation="vertical" > 6. 7. 8. android:id="@+id/horizontalscrollview" 9. android:layout_width="match_parent" 10. android:layout_height="wrap_content" 11. android:background="@drawable/item" 12. android:fadingEdge="@null" 13. android:scrollbars="none" > 14. 15. 16. android:id="@+id/linearlayout" 17. android:layout_width="match_parent" 18. android:layout_height="match_parent" 19. android:orientation="horizontal" 20. > 21. 22. 23. 24. 25. android:id="@+id/viewpaper" 26. android:layout_width="fill_parent" 27. android:layout_height="match_parent" 28. android:layout_weight="1" > 29. 30. 31.
2,接着看看
1.
2. 3. android:layout_width="fill_parent" 4. android:layout_height="fill_parent" 5. android:orientation="vertical" 6. android:background="@drawable/image2"> 7. 8. 9. 10. android:id="@+id/elistview" 11. android:layout_width="fill_parent" 12. android:layout_height="wrap_content" 13. android:layout_marginLeft="5dp" 14. 15. 16. /> 17. 18.
3.接着看看下拉更新的布局
1.
2. 3. android:layout_width="fill_parent" 4. android:layout_height="fill_parent" 5. android:background="@drawable/image1" 6. android:orientation="vertical" > 7. 8. 9. android:id="@+id/listView" 10. android:layout_width="fill_parent" 11. android:layout_height="fill_parent" />


发布评论