Reputation: 91
Gradually learning to like mono touch
Is there an equivalent to the FindName function so i can manipulate a control from its "string" name
Upvotes: 3
Views: 58
Reputation: 32694
In addition to the tag as suggested by Philippe, what you can do is create an "Outlet" in your class that references the control, which will give you the equivalent of referencing it by name.
Upvotes: 1
Reputation: 171784
UIKit controls (views) don't have names, but they do have tags, which are integer values
You can find a control/subview by calling ViewWithTag():
UIView subview = new UIView(..);
subview.Tag = 100;
parentView.AddSubview(subView);
In another method:
UIView subView = parentView.ViewWithTag(100);
Upvotes: 3