How to improve tap-ability of buttons on toolbars and navigation bars in iOS 7

蹲街弑〆低调 提交于 2019-12-10 21:29:58

问题


With the new iOS 7 "flat" look, take for example the + button to add new items such as in iOS's Contacts app. In my app, the + is very hard to tap, the button size seems very small and was never an issue in iOS < 7 and now in iOS 7 it is an issue.

I looked at the Contacts app and if you experiment with it, notice how far left of the button you can tap and the button registers the tap. The same applies as I noticed in the iPad mail app above the e-mail item list, the Edit button for the UITableView also registers the tap far left of the word "Edit".

How can I improve tap-ability of buttons like this on either navigation bars or toolbars? Both of which are BarButtonItems. My main concern is the + button implementation but it looks like whatever technique Apple is using would be a good design to adopt to improve tap-ability of button items.

Thank you.


回答1:


If you use UIBarButtonSystemItemAdd, you should be able to tap a fairly large distance away from the button. Here's a screenshot showing where I was tapping, and as you can see the button is pressed:

A button like this can be created using code like this:

[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addPressed:)]

You can also create one in interface builder:



来源:https://stackoverflow.com/questions/19236869/how-to-improve-tap-ability-of-buttons-on-toolbars-and-navigation-bars-in-ios-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!