English 中文(简体)
用可调语写成子
原标题:Customizing the add button in UITableView

我想知道,是否有一种方法使正常的“+”纽芬兰文在<条码>中定制“initWith BarButtonSystem:UIBarButtonSystemAdd方法。

这是我的现行法典:

UIBarButtonItem *addButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:nil action:nil];
    self.navigationItem.leftBarButtonItem = addButtonItem;
    [addButtonItem release];

感谢任何要点。

最佳回答

What i did to a 3rd party TableView package was creating my own UIBarButtonItem and settig the target & action properties to the ones of the original button. In some cases this will work and in some cases it won t (like if the target checks the source-object for a specific object) - but it s worth a try!

问题回答

除<条码> 字标/代码”外,您可更改以这种方式创建的条形纽。 如果您正在寻找其他定制,则最好有initWithImage: 风格:target:action:

再次感谢马丁。 我认为,展示守则可能是有益的。

而不是:

UIBarButtonItem *addButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:nil action:nil];
    self.navigationItem.leftBarButtonItem = addButtonItem;
    [addButtonItem release];

我只是利用了这一点:

UIBarButtonItem *addButton = [[UIBarButtonItem alloc]
                                  initWithTitle:@"Add" style:UIBarButtonItemStyleBordered 
                                  target:nil action:nil];
    self.navigationItem.leftBarButtonItem = addButton;
    [buttons addObject:addButton];
    [addButton release];




相关问题
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, ...

热门标签