あなたUILable
が長すぎる場合は、 navigation bar Title like this way in
iPhone`を設定できますが、iPadでは同じロジックを使用できます:-
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.navigationItem.leftBarButtonItem = self.editButtonItem;
UIBarButtonItem *addButton = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)] autorelease];
self.navigationItem.rightBarButtonItem = addButton;
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0.0, 0.0, 320.0, 44.0)];
[label setBackgroundColor:[UIColor clearColor]];
[label setNumberOfLines:0];
[label setTextColor:[UIColor whiteColor]];
[label setTextAlignment:UITextAlignmentCenter];
[label setFont:[UIFont systemFontOfSize:12]];
NSString *str =@"1234567890 1234567890 1234567890 1234567890 1234567890 123456";
[label setText:str];
self.navigationItem.titleView = label;
}
お役に立てば幸いです.. :)