开发者

Iphone create uibarbutton without interface builder

开发者 https://www.devze.com 2023-01-12 18:05 出处:网络
i wantcreating uibarbutton without interface builder = (whit code) and this button开发者_Go百科 is style camera

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

精彩评论

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

关注公众号