SwipeMenuLayout
SwipeMenuLayout copied to clipboard
如果 swipe 为自适应wrap_content,高度不确定,如果让滑出的菜单高度跟随自适应高度呢?
<cn.ljp.swipemenu.SwipeMenuLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/swipe_menu_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#e9e9e9" app:isEnableLeftMenu="false" app:isEnableSwipe="true" app:isClickMenuAndClose="false" app:isOpenChoke="true">
<RelativeLayout
android:id="@+id/ll_item"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!--也可以是复杂的item布局-->
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"/>
</RelativeLayout>
<TextView
android:id="@+id/tv_menu1"
android:layout_width="60dp"
android:layout_height="match_parent"
android:background="#fff"
android:text="取消关注"/>
<TextView
android:id="@+id/tv_menu2"
android:layout_width="60dp"
android:layout_height="match_parent"
android:background="#f00"
android:text="删除"/>
</cn.ljp.swipemenu.SwipeMenuLayout> 这样写,菜单并不能填满高度