1

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.

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

CJM
  • 249
  • 1
  • 4
  • 16
  • Where does the first button reside? Like in a `StackLayout` maybe? Also, are you using XAML or straight C# code? Finally, are you using Xamarin Forms or just Xamarin Android? – hvaughan3 Nov 19 '15 at 23:42

1 Answers1

1

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?

Also, Xamarin Android is same as native Android. I would suggest you search your queries in native android also and then you can easily convert the code to Xamarin Android

Community
  • 1
  • 1
Anees Deen
  • 1,385
  • 2
  • 17
  • 31
  • Not really Listener's and delegates are different implementations –  Jan 12 '16 at 18:38
  • Yes, Apparently not all the things are same as native android. But, I suggested a way of looking around the solution. We dont want to search solutions in Xamarin android perspective alone. – Anees Deen Mar 07 '16 at 07:42