Reputation: 2200
i don't know about this:
is it possible that if user switch to Landscape view then size of uitextfied change as i have 4 text file in view ....just look and feel
Upvotes: 1
Views: 322
Reputation: 1985
If you are using IB you have two ways of doing it.
using the auto resize properties in object inspector of Interface Builder. That will resize your textfields automatically.
If that does not suffice your needs, you will have to control that in your ViewController method
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
if (UIInterfaceOrientationIsPortrait (fromInterfaceOrientation)) {
txtField.frame = CGRectMake(0, 0, 400, 31);
}
else {
//orientation for portrait
}
}
Upvotes: 2
Reputation: 642
yes you can change the size of the uitextfied by using its "frame" property
txtField.frame = CGRectMake(0, 0, 400, 31);
based on the condition of the device orientation change the size
Upvotes: 0