开发者

An array of views (views that have an UIImage and 3 buttons): Is a custom view/drawRect needed?

Do I need to create a custom view (i.e., a subclass of a UIView where I override drawRect) in order to eventually make an array containing those custom views? Because I ultimately want to make a scrollView that implements page control and displays a number of views (i.e., the array of custom views) on separate pages. The views are just an UIImage above开发者_Go百科 three buttons. And the image for one view is different for each other view (e.g., electronic flash cards).


It doesn't look like you need a custom view to override drawRect: since you are looking to build a collection view using a single image view and three buttons. However it will not hurt to create one so that accessing the sub views can be done via named properties. For example, customObject.imageView and customObject.firstButton. As a unit it makes sense to create one as it will be messy to keep track of all the image views and buttons you would end up adding to the scroll view otherwise.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜