iphone - adding uitextfields dynamically at runtime -
i want generate textfields dynamically in app scenario having textfield , button if entered number 2 in textfield , pressed button, 2 texfields must generated on view controller
you can achieve using code;
int num=yournum; (int = 1; <= num; i++) { uitextfield *textfield = [[uitextfield alloc] initwithframe:cgrectmake(...)]; textfield.tag = i; ... [self.view addsubview:textfield]; }
and access correct text field afterwards you'd call [self.view viewwithtag:tag]
.
Comments
Post a Comment