Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Unique ID for programmatically created controls

$
0
0

Hi All

I am programmatically creating controls on the screen. If I create a control in XML I can assign the ID as such

android:id="@+id/btnAddTask"

When I do it in code I only have the option to set an integer.

Button btnAddTask = new Button (this); btnAddTask.Id = 5;

The problem comes if I have two controls with the same ID. So is there a way of generating an ID which is not being used by a different control.

Cheers


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>