如何创建可扩展的形式? [英] How to create Expandable Forms?

查看:157
本文介绍了如何创建可扩展的形式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个非常可怕的局面。我需要创建一个 ExpandableListView 包含窗体/布局。

I am in a very terrible situation. I need to create an ExpandableListView which contains Forms/Layouts.

这应该如何工作。

ExpandableListView 包含2个标题。的联系人的和的地址的。当用户展开的联系人的,它应该显示的联系人的形式。当用户展开的地址的应该显示的地址的形式。

The ExpandableListView contains 2 headings. Contacts and Address. When the user expand the Contacts, it should display the Contacts form. When the user expand the Address it should display the Address form.

这些形式包含各种事情,包括 TextViews EditTexts ImageViews 等,最有可能的,这些将在 RelativeLayout的,因为它们是形式,你知道,需要寻找专业的。

These forms contain various things including TextViews, EditTexts, ImageViews etc. Most probably these will be in a RelativeLayout because they are forms, and you know, need to look professional.

我试过很多教程,包括


  1. http://www.vogella.com/articles/AndroidListView/article.html

  2. http://www.androidhive.info/2013 / 07 / Android的可扩展列表 - 视图 - 教程/

  3. http://www.mkyong.com/android/android-listview-example /

  1. http://www.vogella.com/articles/AndroidListView/article.html
  2. http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/
  3. http://www.mkyong.com/android/android-listview-example/

但没有找到,甚至一个线索,几乎够了。

but didn't even find a clue, and almost fed up.

我的问题是,我该怎么办呢?有没有这样的限制,我必须用 ExpandableListView ,这是否可以用另一种方式来完成的,我准备好了。

My question is, how can I do this? There is no restriction such "I must use ExpandableListView", if this can be done in another way, I am ready.

请帮忙。

推荐答案

您可以做到以下几点。创建具有以下布局:

You could do the following. create a layout that has the following:

1. A Heading or a textview with the label contacts
2. Below it a layout that has forms related to it
3. Add another textview below #2 and name it address
4. Add a lyout below #3 .

的布局2和4将具有能见度在第一种情况下消失

The layout 2 and 4 will have visibility gone in the first case

当用户点击版面1,还是先TextView的,进行布局2可见,反之亦然。做第二的TextView一样。

When the user taps on layout 1, or the first textview, make layout 2 visible and vice versa. Do the same with the second textview.

希望有所帮助!

这篇关于如何创建可扩展的形式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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