上显示从该列表刷卡一个项目列表视图按钮 [英] Show button in a list view on swiping one item from that list

查看:123
本文介绍了上显示从该列表刷卡一个项目列表视图按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个Android应用程序,我想显示一个按钮,当用户刷卡列表的特定项目。

I am working on an android application and I want to show a button when user swipe a particular item of list.

下面是我的XAML中,我有一个按钮和一些其他物品。我使用此XML在我的列表视图:

Here is my xaml in which I have a button and few other items. I am using this xml in my list view:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:background="#f1eff0">


    <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:visibility="visible" android:id="@+id/tb1">

        <TableRow>
            <TextView android:id="@+id/createdBy" android:typeface="normal" 
                android:singleLine="true" android:textSize="14sp" android:textStyle="bold"
                android:layout_width="wrap_content" android:textColor="#000000"
                android:layout_height="wrap_content" />
        </TableRow>
        <TableRow>
            <TextView android:id="@+id/postText" android:typeface="normal"
                android:singleLine="true" android:textSize="14sp" android:textStyle="normal"
                android:layout_width="wrap_content" android:textColor="#000000"
                android:layout_height="wrap_content" />
                <Button android:id="@+id/btnDelete" android:textColor="#ffffff" android:visible="Gone"
                android:background="@color/hover_button" android:text="Delete"
                android:textSize="14sp" android:textStyle="normal" android:typeface="normal"
                android:layout_marginLeft="320dp" />
        </TableRow>
        <TableRow>
            <TextView android:id="@+id/postDate" android:typeface="normal"
                android:singleLine="true" android:textSize="14sp" android:textStyle="normal"
                android:layout_width="wrap_content" android:textColor="#000000"
                android:layout_height="wrap_content" />
        </TableRow>
    </TableLayout>
</RelativeLayout>

我已经搜索在谷歌,但不明白我是新为Android的例子,请帮助我。

I have already searched on google but could not understand the examples I am new for android please help me.

推荐答案

下面的链接将帮助您实现刷卡ListView中删除操作。

The following link will help you in implementing the swipe delete action in the listview.

<一个href=\"http://andhradroid.word$p$pss.com/2012/07/05/how-to-implement-swipe-delete-operation-in-android-like-iphone/\"相对=nofollow>刷卡删除列表视图操作

这篇关于上显示从该列表刷卡一个项目列表视图按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆