如何管理专用添加列表,删除按钮? [英] How to manage list with dedicated add and remove button?
问题描述
我想创建一个视图显示像在添加图片和删除的ImageButton。在任何这些点击将开始新的活动,获得的联络方式及设置/替换上的点击索引。
例如如果我点击绿色的1号按钮,它会添加联系人照片和名字在第一排和像明智他人。我能够启动活动来获得联系信息,但我遇到困难来管理这个布局和设置点击这个事件。
现在我用3个不同的RelativeLayout与所有不同行的组件。我知道这会限制我,以方便高达3。
所以这里是我的问题:
1.怎样才能让一个用户界面,这样我可以成长这个名单我是多么想(为截至目前3是确定)。
2.如何使用添加和删除按钮,将因为有行才起作用。
3.我也想只显示联系人的姓名下方的联系电话。
4.在任何一行将显示其详细的点击。
我将AP preciate更好的用户界面,可满足上述要求的任何建议。
在此先感谢。
问候..
Sourabh
- 怎样才能让一个用户界面,这样我可以成长这个名单我是多么想(为截至目前3是确定)。
块引用>使用
的ListView
与CustomAdapter
。这将允许您显示为多行是必要的。在getView()
方法。创建一个单独的布局
将在你的适配器
类充气,将类似于< ImageView的... />
< TextView的... />
< ImageButton的... />
< ImageButton的... />
2.How使用添加和删除按钮,将因为有行只工作。
块引用>将
的onClick
的getView()
方法中的CustomAdapter
您要创建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解决方案
- 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 aCustomAdapter
. This will allow you to show as many rows as necessary. Within thegetView()
method. Create a separatelayout
that will be inflated in yourAdapter
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 thegetView()
method of theCustomAdapter
you are going to create这篇关于如何管理专用添加列表,删除按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!