开发者

Should I use a UIButton or a simple UITapGestureRecognizer

I'm creating an iOS user interface with a lot of different UIImageViews that will tri开发者_Go百科gger actions when tapped (once is enough). I have the choice between using UIButtons with a custom view (the image) or just setting up a bunch of UIImageviews with an associated UITapGestureRecognizers. In terms of functionality I get the same expected result (action triggered on tap). My question is more about performance: the app will (lazily) load around 300 of these touchable UIImageViews in a scroll view. In terms of memory allocation which technique would you suggest?

Thanks for any help and guidance!


UIButtons. They were designed for this and have been extensively optimized by Apple for [touches]. If you might need more advanced functionality in the future, you might use a UIImageView subclass w/ UITouch events. Good luck!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜