简体   繁体   English

Xamarin Xaml是否动态创建控件?

[英]Xamarin Xaml dynamically creating controls?

I have been looking around alot and cannot find any resources that explain how to dynamically add controls to a form. 我一直在四处查看,找不到任何资源来解释如何向表单动态添加控件。 This is on a android application. 这是在android应用程序上。

Essentcially all im looking to do is have a button that when clicked adds another button underneath. 基本上,我想做的就是有一个按钮,当单击该按钮时,它会在下面添加另一个按钮。 Then when clicked again adds more buttons etc etc. 然后,再次单击时添加更多按钮等。

Can anyone direct me to some examples of tutorials that can help me? 谁能指导我一些可以帮助我的教程示例?

Thanks 谢谢

You can create your controls based on your need. 您可以根据需要创建控件。 The following link will help you to create buttons. 以下链接将帮助您创建按钮。 This is applicable for all controls 这适用于所有控件

How to add a button dynamically in Android? 如何在Android中动态添加按钮?

Also, Xamarin Android is same as native Android. 此外,Xamarin Android与本机Android相同。 I would suggest you search your queries in native android also and then you can easily convert the code to Xamarin Android 我建议您也在本机android中搜索查询,然后将代码轻松转换为Xamarin Android

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

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