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

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - Updating recent updates - Problem in procedure - Any other approach? -