UINavigationBar全体に合うようにUITextFieldのサイズを設定するにはどうすればよいですか?これまでのところ私はこれを持っています:
locationField = [[UITextField alloc] initWithFrame:CGRectMake(37,7,246,31)];
locationField.delegate = self;
locationField.autoresizingMask = UIViewAutoresizingFlexibleWidth;
locationField.textColor = [UIColor colorWithRed:102.0/255 green:102.0/255 blue:102.0/255 alpha:1.0];
locationField.textAlignment = UITextAlignmentLeft;
locationField.borderStyle = UITextBorderStyleRoundedRect;
locationField.font = [UIFont fontWithName:@"Helvetica" size:15];
locationField.autocorrectionType = UITextAutocorrectionTypeNo;
locationField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
locationField = [[UITextField alloc] initWithFrame:CGRectMake(37,7,246,31)];
私は基本的にUINavigationBarに合わせたいと思っていますが、おそらくsizeToFit
それを実装する方法が100%確実ではありません。
ありがとう。