实现微信朋友圈的点赞功能,代码很简单,就是设置一个布局,然后使用popupwindow让这个布局显示出来就可以了
实现效果图:
1.主界面的布局就是一个listview,这里就不贴了,需要的话请自己补上
2.使用baseadapter设置listview条目显示的内容,布局如下listview_item.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="50dp"> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:text="点赞" /> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_alignParentTop="true" android