views:

454

answers:

5

How 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.

+2  A: 

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];
Alex Reynolds
How do I do this with a UILabel that is in a Nib? The UIViewController Nib's view is a AFOpenFlowView, and I'd like to lay out my interface elements in it rather then do so programmatically. Thanks!
Edward
If you're doing this in IB, I think it's even simpler: Make your view controller `view` a `UIView` view, drag an `AFOpenFlowView` view "under" or "into" the top-most `UIView` and drag a `UILabel` under or into the `UIView`. In your view controller, set these as properties as `IBOutlet` types and wire them up in IB as per usual. This accomplishes the same ordering of subviews as the code in my answer.
Alex Reynolds
A: 

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.

Nimrod
A: 

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.

Corey Floyd
A: 

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 !

Fredio31
A: 

i have the same code as Alex Fajkowski's implementation of CoverFlow called OpenFlow with same nib file.. but i am still unable to have the label.. i have added the label in FlowCoverViewController and also done bring subview to front but still failed to get the label. Also i want the flip effect same as iPod application in iPhone.. Any help will be really grateful.. I am new to coverFlow... Sorry for posting the question here.. As it was the same as i m referring to so... Thanx in advance

Suriya