self.navigationItem.titleView在旋转后切断UIBarButtonItem

时间:2012-12-08 19:28:22

标签: objective-c ios uikit

我使用了self.navigationItem.titleView,并在self.navigationItem.rightBarButtonItems中设置了两个UIButtons作为UINavigationBar。我已经在我的navigationBar中实现了这一点,就像

一样

每当我旋转视图控制器景观然后再返回时,uibarbutton项就会被切断

我用来设置titleView的代码是:

UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 44)];
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.numberOfLines = 2;
titleLabel.font = [UIFont boldSystemFontOfSize:13.0f];
titleLabel.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5];
titleLabel.textAlignment = UITextAlignmentCenter;
titleLabel.textColor = [UIColor whiteColor];
titleLabel.text = self.tabTitle;
self.navigationItem.titleView = titleLabel;

我不知道为什么会这样,我想知道你是否有人知道如何解决这个问题。

0 个答案:

没有答案