开发者

How to truncate the content of back button in UINavigationController?

开发者 https://www.devze.com 2023-01-01 15:30 出处:网络
I need to truncate the string content of back button of navigation controller. Let me 开发者_高级运维explain clearly. I have large title in First view controller, same name is appearing in the next vi

I need to truncate the string content of back button of navigation controller. Let me 开发者_高级运维explain clearly. I have large title in First view controller, same name is appearing in the next view controller while navigating in a back button. So much space is occupied by back button, I could not able to set the title clearly in next view controller.

How can I truncate the content of Back Button. Please help me out of this.

Thanks, Madan Mohan


You could try setting a custom back button for the first view controller, with the truncated title.

[self.navigationItem setTitle:@"A really long title"];

UIBarButtonItem * newBackButton = [[UIBarButtonItem alloc] initWithTitle:@"A really.." style:UIBarButtonItemStyleBordered target:nil action:nil];
[self.navigationItem setBackBarButtonItem:newBackButton];
[newBackButton release];
0

精彩评论

暂无评论...
验证码 换一张
取 消