简体   繁体   中英

Toolbar buttons similar to Evernote iPad app

Can anybody suggest me how to create toggle buttons in UIWebView Keyboard's toolbar very similar to what Evernote application has when you edit a note. I know how to add buttons in that toolbar. I just want to know how can I create the buttons look like that. Can this be achieved using simple UISwitch?

This is what exactly I want to achieve. UIWebView键盘工具栏上的按钮

This can be achieved with a UIButton . Either set the image for UIControlStateSelected on the button or do it in Interface Builder by changing the image for "Selected State Configuration". You can then toggle the button state by changing the selected property of it.

Ex:

[button setImage:[UIImage imageNamed:@"button_on"] forState:UIControlStateSelected];
button.selected = YES;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM