Java Xml文件图像覆盖图像
我想从这里创建一个带有滑动(正面和背景)的列表视图: 我创建了一个xml文件,该文件定义了行元素:Java Xml文件图像覆盖图像,java,android,Java,Android,我想从这里创建一个带有滑动(正面和背景)的列表视图: 我创建了一个xml文件,该文件定义了行元素: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:la
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/front"
android:tag="front"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#ffffff">
<ImageView
android:id="@+id/ImageView01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/ImageView01"
android:layout_centerHorizontal="true"
android:textSize="18sp"
android:textStyle="bold"
android:inputType="textMultiLine" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/back"
android:background="#e3e3e3"
android:tag="back"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
>
<Button
android:id="@+id/deleteBtn1"
android:layout_width="150dp"
android:layout_height="100dp"
android:text="Delete" />
<Button
android:id="@+id/UpdateBtn1"
android:layout_width="150dp"
android:layout_height="100dp"
android:text="Update" />
</LinearLayout>
</FrameLayout>
以及listview xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/linearLayout1"
android:orientation="vertical" >
<EditText android:id="@+id/EditText01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:hint="Search">
</EditText>
<com.fortysevendeg.android.swipelistview.SwipeListView
xmlns:swipe="http://schemas.android.com/apk/res-auto"
android:id="@+id/example_lv_list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="@drawable/profile_listview_back"
android:listSelector="#00000000"
swipe:swipeActionLeft="dismiss"
swipe:swipeActionRight="reveal"
swipe:swipeBackView="@+id/back"
swipe:swipeCloseAllItemsWhenMoveList="true"
swipe:swipeFrontView="@+id/front"
swipe:swipeMode="both" />
</LinearLayout>
但是,当我运行此listview时,它会在前面显示背景(我希望只有在我滑动前面时,它才会显示后面)
我希望删除和更新按钮仅在刷正面时显示
我怎样才能解决它?非常感谢
在行布局中,您应该在相对布局之前进行线性布局 元素的顺序很重要
<LinearLayout>
.... buttons ....
</LinearLayout>
<RelativeLayout>
.... image and text ....
</RelativeLayout>
.... 按钮。。。。
.... 图像和文本。。。。