Adding a Stationary Button Overtop of a Map View - iphone

I have a really quick question which is probably ridiculously simple. I currently have an application that I am using route-me and OpenStreetMap, and basically I have a view that loads the map into the entire window.
When trying to run the project with a button added to this view in Interface Builder, the map loads overtop of the button, and is not displayed.
The map view is loaded by a custom class RMMapView (route-me class), and I already know how to add markers to the map itself, but not a stationary button in the corner of the screen that won't move as the user drags the map around. I want to add the button as an overlay, a view overtop of the map view itself.
If you guys could give me any tips on how to do this I would greatly appreciate it.
Thanks.

[mapView bringSubviewToFront:button];
Maybe this helps.

Add the mapView as a subview to a view, and add the button as a subview to the same view.

In Interface Builder, on the left side pane that has all the scenes, switch the positions of the button and the MapView. If the button is listed above the MapView, drag it down so it's below it.. or vice versa. This will change which view is on top of the other.

Related

How to add view like this

As shown click the top three buttons will pop up a view on the basic view. What the view is? CALayer? Or just a small size UITableView? How to implement this?
the control is like a UIPopoverController - but UIPopoverController is limited to iPad only. here's a source which have generic/custom implementation that will help you creating similar view.
https://github.com/werner77/WEPopover
I belevie this is a custom view that contains a table view inside it. it is very simple to implement that, As this is not a full tutorial I can imagine the basic steps I would do:
the shape could be a combination of layers or more reasonable drawn with Quartz2D:
I would do it this way:
create view and draw the frame with a BezierPath in the drawRect:
+ (UIBezierPath *)bezierPathWithRoundedRect:(CGRect)rect cornerRadius:(CGFloat)cornerRadius
draw the top black bar and the title on the top.
draw the top triangle and add to the view a property that will set the position according to the button position. then you could conditionally change the draw position of the triangle.
add a sub view of a table view and assign the view as a DataSource and a Delegate of it, and then do all the table view implementation.
Good luck
It's just a custom view. There is probably a UITableView embedded in the view for the friend request list.

iPhone Fall Down button (Animation)

Is it possible do something like this ?
When I click on the button I need the following animation: button to set some alpha filter and starts to fall down as indicated by the arrow, it will disappear on tab.
Can you tell me how to do this ? Thanks a lot ...
Here is image url: http://img534.imageshack.us/img534/8149/screenqx.jpg
It's definitely possible, but there are some issues you have to overcome. One is that UIBarButtonItem isn't a UIView. One way is to loop through the subviews of the UIToolbar or UINavigationBar. Another way is to figure out the position of the button. Another is to get the view using private api if you're not submitting to the AppStore.
Once you have the view, you can move it to the superview of the UIToolbar or UINavigationBar or you can create a view on top of that (and hide the real UIBarButtonItem since you're done with that). The latter is more difficult because mimicking the look of the default bordered UIBarButtonItem isn't easy.
Now you need to get the center of the UITabBarItem somehow. You can either use private api or you can loop through the subviews.
Create a CGPath using Quartz functions or using UIBezierPath. The start point will be the center of the button and the end point will be the center of the UITabBarItem.
Create a CAKeyFrameAnimation and attach said CGPath.
Create a CABasicAnimation to animate the opacity.
Add both to a CAAnimationGroup.
Attach the animation group to your button view's CALayer.
Make sure to also set the position and the alpha in order to prevent the view from jumping back to its original position after the animation.
Once you attach the animation group, the animation should start, so make sure you're doing all of this in the button's selector method.
You can't really move it from view to view, as your views could clip and then you'd get frames with only a partial image. Probably the best thing to do is to create a view on the fly which covers the whole screen, copy the button image into the view at the original point, remove the button from the original view, then animate that image to where you want it to go, then add the button to the final destination.

Callout accessory on tapping images

I have some images in my viewcontroller's view. When I tap on each image I need to have a callout accessory, just like the one we get when we tap on a pin in the mapview. I read that this is normally used on annotations in mapviews. Could this be done on images in a view. Need help.
You can make your own custom view similar to the annotation in mapview. That you can add on the image on tap and remove that view when you tap again somewhere.

floating button above UIScrollView in Storyboard

Is there an easy way of putting a 'floating' button above a UIScrollView in Storyboard? I would like to add a lock button to toggle scrolling on and off. I guess I could do this in code but it would be nice if it could also be done via XCode.
Just drag the button onto the view somewhere over your UIScrollView. Now, IB will automatically dump it in the scroll view, but you can move it out by using the object browser.
Open the object browser
Drag the button out to the same level as the UIScrollView
Ensure that the button is below the scroll view in the list (this means it's above the object in the view hierarchy)
You may have to use the inspector to set the button's actual location rather than dragging it around. Dragging it around for placement will most likely cause it to jump back into the scroll view.

Making fancy views with Cocoa Touch

I should want to make an interface in which i put a UIImageView in the left bottom corner of my main view controller and , if user touch that Image an empty sheet of paper "fly" from it and "land" as an complete interface (with buttons, textfields etc)...
What should be my starting point?
Thank you!
Start reading about Core Animation