iphone - Placing a UITextField in the center of the view -
i have uitextfield
, want center field on center of view. ideas?
usernamefield = [[uitextfield alloc] initwithframe:cgrectmake(0, 200, 200, 28)];
instead of cgrectmake(some numbers)
- want place in center of view.
you can directly assign center of desired view:
usernamefield = [[uitextfield alloc] initwithframe:cgrectmake(0, 200, 200, 28)]; usernamefield.center = myview.center;
Comments
Post a Comment