开发者

Iphone create uibarbutton without interface builder

i want creating uibarbutton without interface builder = (whit code) and this button开发者_Go百科 is style camera please help me


Objective-C:

UIBarButtonItem* cameraBarButtonItem = 
     [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCamera
     target:self action:@selector(myCameraAction)];

Swift:

let cameraBarButtonItem = UIBarButtonItem(barButtonSystemItem: .Camera, target: self, action: "myCameraAction")

This will create a UIBarButtonItem with the system item icon of the camera.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜