UISplitViewController does not recognize device rotation when covered by modal movie player - ios6

[This was posted on the Apple Developer Forums but has not been answered, so I'll try here.]
My application uses a UISplitViewController for iPad master/detail views and runs on iOS 6. The split view controller is the root view controller for its window. The detail view consists primarily of a UIWebView embedded in a UINavigationController. The only other elements in the detail view are the toolbar and navigation bar offered by the navigation controller. When the web view is displaying a page with an embedded YouTube video, the user can make the video full screen. This is all done by the UIWebView---I am not responsible for creating a full-screen video player. In case it matters, once the video player is placed in a full-screen view, the keyWindow of the UIApplication shared instance is not the main application window during video playback, but is instead an instance of MPFullScreenTransitionViewController.
If the user rotates the device during this full-screen playback, and then ends playback, the UISplitViewController does not properly place its children. The methods
splitViewController:willHideViewController:withBarButtonItem:forPopoverController:
and
splitViewController:willShowViewController:invalidatingBarButtonItem:
of the delegate (in this case, the detail view controller) are never called.
If the device was rotated to a landscape orientation while playing full-screen video, dismissing the movie player results in the presentation of a detail view controller that retains its former bar button item to draw the master view controller in a popover (although tapping the button produces no action). Where the master view controller should be drawn, only a black region exists. Swiping right in the detail view controller will slide out the master view controller that covers the black region, but this still exists as a popover rather than a persistent view.
If the device was rotated to a portrait orientation while playing full-screen video, dismissing the movie player results in the presentation of a detail view controller that lacks a bar button item to draw the master view controller in a popover. The detail view controller has the correct width, and the master view controller is not visible, so the appearance of the detail view is almost as expected except for the missing bar button item.
In both cases, manually rotating the device after the incorrect view appears will restore proper application functionality. However, relying on the user to rotate (or double-rotate) the device to fix drawing problems is clearly unacceptable.
Is there some way to ensure that the split view controller becomes aware of device rotations when all of its children have disappeared behind a modal movie player?

The answer was suggested by user SamuraiZack on the Apple Developer forums. In the delegate for UISplitViewController, force relayout of the split view controller in viewWillAppear:
[self.splitViewController.view setNeedsLayout];
[self.splitViewController.view layoutIfNeeded];
The original response can be viewed on the Apple Developer forums.

Related

WPF: Adorner + Popup = Modal Popup

So here's the idea of it...
I have an application that I am designing with WPF. It has a Main Window with a frame inside to navigate through pages. The navigation aspect is done through the window (kind of like a template with a footer that has the navigation controls) and the pages have the individual content. On certain pages I would like to have an ADD (+) button that causes a popup that has a form inside to add personal information to the database (First name, last name, address, .etc) While this popup is open I would not like them to be able to access any other part of the application until they press OK or CANCEL. I'd like to be able to call this popup from the individual pages unless there is another workaround.
Any ideas or assistance would be appreciated!
some wpf popups Here and Here.

Backbone View Architecture

I have 2 parts in my application:
A grid of players each with a thumbnail to click which activates a detail view on the left side of the page.
Detail view - activated when player is clicked on grid.
The model is very straightforward and will be read only. (Player model and Players collection)
The way I am thinking of organizing views is as follows:
AppView - main view that fetches collection (to create grid) and populates the grid. (JSONP is done in model) and manages events for the grid such as pagination.
PlayerThumb View - The view that contains a thumbnail of player that can be clicked from inside the grid.
CardView - This view contains the players large picture as well as stats about the player.
My confusion is how do I communicate information to the card view when a player thumb view is clicked?
What is the responsibility of the AppView? Is it doing too much? Should I create a PlayerGridView? If this is the case, what would app view be used for?

Navigation bar button item missing after segue style "Replace"

The iPad app that I'm working on makes use of Storyboards and segues. I'm trying to display a different view controller when the user clicks on different cells in the master view.
After referring to different tutorials, the steps that were taken were -
In the Storyboard, Master View Controller, created static cells for the table view and added 3 different rows (i.e. cell 1, cell 2, cell 3)
Added a View Controller, selected it and attached a Navigation Controller to it (Editor -> Embed In -> Navigation Controller)
From cell 1 in Master View, I did a ctrl-click on the Navigation Controller.
Chose Segue Style "Replace" and Destination "Detail Split"
In tableView:didSelectRowAtIndexPath, added [self performSegueWithIdentifier:#"NewViewController" sender:self] to do the transition.
The result that I see is the detail view gets replaced.
But the navigation bar does not have the bar button item Master.
So I'm unable to click the Master button which would show the table containing cells from where I can navigate to a different view.
I've already read many blogs and seen commentary which talk about replacing a segue for similar problems. However nobody seems to have faced this specific issue while using storyboards and segues.
From my understanding using segues should help me achieve what I want. From those who have tried this approach, any pointers in the right direction will be helpful.
Try changing the Segue Style from Replace to Push. It should resolve your problem.
When you push a UIViewController on a UINavigationController, it will be added to a stack and you will be able to navigate back :
Your navigation controller stack before tapping "Detail":
Master
Your navigation controller after tapping detail and navigating a little more ...:
Master -> Detail (Navigation button is displayed) -> Some other details (Navigation button is displayed) -> And maybe some more (Navigation button is displayed)
When you call a new segue using Replace like you did, the Master will be replaced with Detail, and you will not be able to navigate back because Master was replaced and it's not on the stack anymore.
Your navigation controller stack before tapping "Detail":
Master
Your navigation controller after tapping detail using replace like you did:
Detail (no navigation button because master was replaced and we don't have nothing more on the stack)

WPF + PRISM - show modal popup window with controls in it?

I am following the 'Stock Trader RI' example by the Prism team,
but it does not address this exactly :
I have a Shell with a Main Region in it.
In this shell I have some filter fields and a grid.
When I press on a button - I would like to load a screen that allows me to change the filters,
and then press 'Save'. This would then call a service to update the fields, and close the pop-up.
Here is an illustration of the 'Shell' before pressing the button (left) and after (right) :
Problems are :
The 'Stock Trader RI' sample app only uses a modaless dialog popup. I need a MODAL pop-up (background will continue to refresh, but user will not have access to it as long as pop-up is active).
Need to have Silverlight-like effect when pop-up shows, meaning - 'Shell' needs to appear 'disabled' (like a gray mask over it).
Pop-up window should have no 'X' button and no 'minimize' or 'maximize' buttons. The pop-up window should be simply a rectangle with curved-corners.
I don't think I can use a 'Notification Window' or a 'Confirmation Window' because I cannot put inside them whatever I want. This is an example with 2 fields, but the pop-up might be much more complex with tabs, and a lot of information shown to the user.
So how do I show a modal pop-up from my "WPF+PRISM" Shell-View-Model once the 'Edit' button is pressed ? (Meaning, once the 'EditCommand' is executed...)
I have found a solution here.
Basically it uses InteractionRequest and it allows me to open a window (that I can style however I want, without the 'Maximize' 'Minimize buttons), and also - I can choose for it to be Modal.
Great thing about this solution is - that I can use custom pop-ups and not only Notification or Confirmation pop-ups.
Also - I can pass information back to the class the invoked the 'InteractionRequest'.
Only thing that it doesn't solve - is that I cannot make the calling view look disabled by adding a gray semi-transparent over it ... haven't figured out yet how to do that...

In my Windows Phone app,I want to turn my current page unable in gray and show a textbox in foreground

Like the title said,how may i turn the grid(or page) and the components in it into background gray and unable and show a new component in foreground.
It's a common effect in the web page,but i cannot do that with a xaml.
Please answer in detail better with sample code if you do.Thanks in advance.
Here's an example of using a Popup to display a UserControl when a Page is navigated to. The OnNavigatedTo function creates a popup, binds a Click event to the UserControl, and then shows the UserControl over the entire page. If the correct password is entered, ("password" in the example) the control disappears. You'll need to modify it for your own requirements, but it should definitely get you started.
https://skydrive.live.com/redir.aspx?cid=ef08824b672fb5d8&resid=EF08824B672FB5D8!343
You'll want to use the VisualStateManager and create some animation transitions to switch between the old and new components. I won't paste the code here for brevity, but if you check out:
http://visualstudiomagazine.com/articles/2011/07/22/wcmob_visual-states.aspx
You'll see a simple example of switching between two UI components on a single page within a Windows Phone 7 PhoneApplicationPage. In your scenario, you'd use this paradigm to create 2 animation storyboards, one for showing an overlay control and one for settings the 'disabled' property on the main grid.

Resources