开发者

UIView efficiency

I have a UIView which is essentially doing two things. The first mode lets the user control things that they've inputted. The second mode lets them input new values to interact with.

To switch between modes it animates the alpha of most of the components of the view to 0.0 and the new ones to 1.0 and it looks real开发者_如何学Cly nice. So far the only downside is that my nib in IB is kind of messy for editing.

I was just wondering if this was the best practice for doing this type of thing or if I should be loading a new view. The components are all just UIKit objects like buttons, sliders, labels, etc.


I would recommend add a second View to your xib which holds the editing elements. Then create an IBOutlet for the second view so you can access it in your view controller. When you are ready to switch between, the code that does the alpha animation can also quickly add that editing view as a subview of your main view starting with a 0.0 alpha. Then your alpha animation will bring it into view. It will look the same to you, but it'll be easier to edit in IB. I set up a simple example and took a screenshot to show you what I mean.

UIView efficiency

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜