Tapping background to close subview in Xcode 4.3 - ios

Currently I am creating an app. for the ipad that uses a media player. When you click on a button the media player pops up and I have code that when you press another button the media player stops and is hidden so you can go back to using the superview. The problem is, I dont want to have to click a button to close the subview, I want to be able to click anywhere on the background to close. I've tried making the whole background a button but I'm having trouble writing code to make it so that the full window button that closes the subview ONLY appears when the subview is up. Right now the full window button is up constantly so I can't click on the button that brings up the subview in the first place because the large button is overlapping. I hope this dilemma is fairly easy to understand. If not I can send some code.

Try a UIPopover instead. What you're describing is the default behavior.

Related

Unity - How to hide Homebar on iOS ( defer system gestures and hide home button )

The game is in landscape mode and at the bottom of the screen are some ui buttons, for this reason I would need to hide iPhone home bar and use deferred edges.
Using "Hide home button on iPhone X" correctly hides the button, but any single tap will show the bar and single swipe will close the game. Not good.
Using deferred system gestures only, behavior is correct, it takes two swipes to close the game. The problem is that the home bar is always visible, its greyed out, but always visible. Gets highlighted on a first swipe, closes game on the second. Thats good, but cant have visible home bar all the time, its right on top of the buttons. Not good.
Used deferred edges and Hide home button option is acting like 1), ie deferred edges are ignored for some reason. Not good.
Question: Is there some way to have home bar hidden and appear only on a swipe and on second swipe closes game. Ie functionality like 2) but the bar is hidden instead of greyed out?
In player settings under Resolution and Presentation you could check Render over native ui
This option will force unity to display app contents over the native ui, however then you need to setup a custom way to close your application.

Popup window in swift for tutorial view

What is the easiest way to create popup window in swift?
For example I have a button called “Help”in the login screen and when I pressed Help button the tutorial screen will appear and blur the background.
I have tried NMPopUpView but didn’t luck to get it work.
Thanks.
If i want a stylised popup then I will create a new Nib file and design it in there. Then when you want to show the popup you can load that NIB and animate it in, upon closing it you can animate it out.

How can I prevent clicking iAd from changing my view?

I have an app that displays buttons, the buttons move around the screen upon being touched. The problem I am having is that you can move the buttons around, however if you click on the iAd advertisement after you move the buttons, the buttons return to their original positions. How can I stop this?
Note: I was having the same problem for a while whenever I did a full screen rotation (only landscape supported). Upon rotation the buttons would return to their original positions. I fixed that problem by changing the segue from modal to push. Not sure if this helps but thought I would mention it.
EDIT: I have been trying to use the ViewWillAppear method to correct the layout, however it is not getting called after closing out of the iAd.

Button delay Highlighting

I'm building an iOS application and I have some buttons inside a PageView Controller inside a ContainerView. The problem is the buttons aren't responsive at all. They only get selected some time after I pressed them.
Is there any fast solution?
Thanks

How to add a button on UIPageViewController

I have created an iPad app, using UIPageviewController in Xcode 4.2 (iOS 5). Now, I want to add a button, at the left-bottom corner of the page, which will appear on every page.
The problem is, while clicking the button, a page transition takes place, and the button click event is not called.
You need to take control over the Gesture Recognizers. Decide which one gets the click, take a look at this post

Resources