简体   繁体   English

相对布局Android

[英]Relative Layout Android

我有一个用户输入表单的布局。当我输入用户名和密码并单击提交按钮时,应保存内容,并且在同一页面上应显示具有三个文本框和编辑框的另一个div。

Replacing the content might not be the best solution. 替换内容可能不是最佳解决方案。

Anyway, you can create all these elements together in the same layout and set the "div with three textboxes and editboxes" initially to "hidden". 无论如何,您可以在同一布局中一起创建所有这些元素,并将“具有三个文本框和编辑框的div”初始设置为“隐藏”。

After you have clicked the button and triggered the desired event, you grab the desired elements and make them visible while setting the unwanted elements to hidden again. 单击按钮并触发所需的事件后,将获取所需的元素并使它们可见,同时将不需要的元素设置为再次隐藏。

Charles Merriams answer would be the more elegant and cleaner way, this only answers the "base" question. 查尔斯·梅里亚姆斯(Charles Merriams)的回答将是更为优雅和简洁的方式,这仅回答了“基本”问题。

您可以尝试DrColossos所说的,也可以通过在按钮单击时设置不同的contentview来尝试。

The magic word you need to look at is "Intent". 您需要查看的魔术字是“意图”。 You call your own application in order to switch layouts after the submit button. 您可以调用自己的应用程序,以便在“提交”按钮之后切换布局。

You may find the Notepad tutorial useful. 您可能会发现记事本教程很有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM