如何管理专用添加列表,删除按钮? [英] How to manage list with dedicated add and remove button?

查看:105
本文介绍了如何管理专用添加列表,删除按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个视图显示像在添加图片和删除的ImageButton。在任何这些点击将开始新的活动,获得的联络方式及设置/替换上的点击索引。

例如如果我点击绿色的1号按钮,它会添加联系人照片和名字在第一排和像明智他人。我能够启动活动来获得联系信息,但我遇到困难来管理这个布局和设置点击这个事件。
现在我用3个不同的RelativeLayout与所有不同行的组件。我知道这会限制我,以方便高达3。

所以这里是我的问题:

1.怎样才能让一个用户界面,这样我可以成长这个名单我是多么想(为截至目前3是确定)。

2.如何使用添加和删除按钮,将因为有行才起作用。

3.我也想只显示联系人的姓名下方的联系电话。

4.在任何一行将显示其详细的点击。

我将AP preciate更好的用户界面,可满足上述要求的任何建议。
在此先感谢。

问候..

Sourabh


解决方案

  

      
  1. 怎样才能让一个用户界面,这样我可以成长这个名单我是多么想(为截至目前3是确定)。

  2.   

使用的ListView CustomAdapter 。这将允许您显示为多行是必要的。在 getView()方法。创建一个单独的布局将在你的适配器类充气,将类似于

 < ImageView的... />
 < TextView的... />
 < ImageButton的... />
 < ImageButton的... />


  

2.How使用添加和删除按钮,将因为有行只工作。


的onClick getView()方法中的 CustomAdapter 您要创建

适配器类别

ListView控件实例

I want to create a view like shown in Image with add and remove ImageButton. On click of any of these will start new activity and get contact detail and set/replace on the clicked index.

For Example If I click on 1st green button It will add contact photo and name in 1st row and like-wise for others. I am able to start Activity to get contact information but I experiencing difficulty to manage this layout and set click event on this. Right now I am using 3 different RelativeLayout with all distinct Row Components. and I know It will restrict me to facilitate upto 3.

so here is my questions :
1. How can I make a UI so that I can grow this list how much I want(for as of now 3 is ok).
2. How to use add and remove button which will work for there row only.
3. I also want to display contact number just below the name of contact.
4. on click of any row will show its detail.

I'll appreciate any suggestion for better UI which can fulfill above requirement. Thanks in advance.
Regards..
Sourabh

解决方案

  1. How can I make a UI so that I can grow this list how much I want(for as of now 3 is ok).

Use a ListView with a CustomAdapter. This will allow you to show as many rows as necessary. Within the getView() method. Create a separate layout that will be inflated in your Adapter class that will look something like

 <ImageView .../>
 <TextView .../>
 <ImageButton .../>
 <ImageButton .../>

2.How to use add and remove button which will work for there row only.

Set the onClick inside the getView() method of the CustomAdapter you are going to create

Adapter Class

ListView Example

这篇关于如何管理专用添加列表,删除按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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