English 中文(简体)
传真:BarBackButton 项目影响
原标题:iOS: NavigationController: BarBackButtonItem influence width

我如何影响BarBackButtonItem的宽度。 我的《国际调查》前书记长很长,我期望SOS缩短了这个中间点......但情况并非如此。 我如何执行?

最佳回答

It sounds like you need to manually truncate the text that appears in the backBarButtonItem.

为此,实施如下准则:

self.navigationItem.backBarButtonItem = 
    [[[UIBarButtonItem alloc] initWithTitle: @"<truncated title>" 
                                      style: UIBarButtonItemStyleBordered 
                                     target: nil 
                                     action: nil] autorelease];
问题回答

关于您的方法pushes 认为,它改变了自己对“Back”的所有权。 然后,在同一控制器中view WillAppear: 法典有其标题。 这种方法运转良好,没有造成任何令人窒息的消亡问题,让你们回来。

(如果你不希望回来,而且你只是想篡改你的头衔,就只是手工地将标题缩下来)





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签