开发者

Floating a UILabel above OpenFlow

How 开发者_StackOverflow中文版do you get a UILabel to float above Alex Fajkowski's implementation of CoverFlow called OpenFlow?

Ok I've figured it out. I just had to use bringSubviewToFront with the UILabel.

Thanks to everybody who answered.


Make an OpenFlow instance and a UILabel instance subviews of a parent view, placing the label atop with flow view using -insertSubview:atIndex:, -addSubview: or similar e.g.:

[self.view addSubview:myOpenFlow];
[self.view addSubview:myLabel];


To answer the second question, try this: edit the AFOpenFlowView in IB and add the label view as a subview of that wherever you want it to appear, then set the attributes on the view to Hidden if you don't want it to appear by default. Create an IBOutlet for the label view in your controller so you can easily manipulate it, such as setting hidden to show in order to show it. I'm not familiar with open flow so I'm not sure if it will programmatically create a subview that will obscure your label. If so you may need to use the outlet to move it to the front using UIView methods.


The Openflow example code shows a perfect demonstration of this. Alex adds an info button in the top right of the openflow view using interface builder. This is exactly what you are asking for.

I would add that if you can't understand what is going on from the example code, you should look at more code examples from Apple demonstrating simple UIView usage.


It's not so easy because the label name has to change for each picture. We have to work with index, and with event.. move.. tap.. selected...I'm working on too !

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜