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

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -