Resizing the detail view if popover comes - ios

I am using master detail layout in my application. Every thing works fine, but when i clicked on the menu the popover comes and it is placed above the detail view. like this
actually in the detail view i have some videos displayed, like this..
when the popover come the videos are not visible, how to resize the detail view so that it moves right automatically when popover comes and the details are displayed like in case of landscape mode. Thank you..

This is how a UISplitViewController works when in portrait orientation. The detail view can't be resized.
However, just before the popover slides into view, the splitViewController:popoverController:willPresentViewController: delete method will be called. You could implement this and adjust the views in your detail controller to shift as needed. But this would not be standard behavior.

Related

Weird scrolling behaviour when using Tab Controller - iOS

I am building an iOS app using Swift. In my app, I am using a paging menu controller (called PageMenu) built from other view controllers placed inside a scroll view (you can view it on GitHub here). It is similar to how Instagram looks:
When I set up the PageMenu in my project, it looks and works great...
BUT, when I embed the view within a Tab Bar Controller to add in a normal iOS Tab Bar, the scrolling within the PageMenu view doesn't work...and I get weird diagonal scrolling, and I can't actually scroll down if there is more content.
Does anyone have any idea of why this might be happening and how to fix it?
Please ensure that you set up the frame size when you are initializing the page menu.
If your scroll view is bigger than the actual view, then you will only be able to scroll the view, and not scroll the content inside it properly.
Set up the frame size of view while embedding. Check the parent view frame size.

iOS7 SplitviewController embedded in ContainerView does not rotate

I am pretty new to iOS and Objective-C but I am trying to create an iPad app with a vertical tab bar down the left hand side and a split view controller taking up the rest of the screen. To achieve this I have put two container views on a page then embedded the splitview controller in the right container.
Here is my story board:
This works fine in landscape, however when I rotate to portrait the split view controller does not rotate as normal and this messes up the whole layout.
Here is what it looks like in landscape, as expected:
Here is what it looks like in portrait:
I've tried various things like manually forwarding willHideViewController and willShowViewController from the container to the splitview controller...
Is there something I'm missing? Or a better way to achieve the layout I'd like?
What happens is, in portrait mode the master view controller is transferred to a popover, which is normally placed off-screen to the left of the detail view controller. In your case, you can see it is also to the left, but this is the incorrect behavior for your case.
Implement the split view controller's delegate protocol, specifically splitViewController:shouldHideViewController:inOrientation: and return NO for any orientation.

Flipboard ipad app: right menu panel slide effect

how to implement right panel slide effect like following picture? when click left area, the right panel is hidden.
picture url http://cdn.thenextweb.com/wp-content/blogs.dir/1/files/2012/02/photo.png
I think
it is not popover controller.
is it a view added by using "addSubview"? I don't think so because it is a navigation controller,it seems that view in navigation controller can't be added by using addsubview
is it a modal view? if yes, how to implement semi transparent background? if use UIModalPresentationCurrentContext to present modal view, parent view can't rotate when ipad is rotated.
Any help is highly appreciated! Thanks.
These are all likely highly customized view controllers, and view controller containers.
You can fully control the presentation of your view controllers by adding them as children of another view controller, and adding their views to the view tree manually -- using any animation you choose.
The dimming effect you see can be achieved by overlaying a "dimming view", for example a black 50% opaque view.

UINavigationController scrolls down on back button click

I'm working on an iPhone / iPad app with several navigation controllers. When I click a back button of a view while the device is in landscape mode, the previous view scrolls vertically into the screen, instead of scrolling horizontally as usual.
Push animations always work horizontally, as it should be.
What could be causing this weird problem?
Thanks,
Adrian
Are you sure the view controller, you're getting back to, is set to deal with rotation properly ?
I had a similar issue using MonoTouch.Dialog until I added Autorotate = true; to every (non-leaf) DialogViewController inside my application.

Toolbar hiding on rotated UISplitView DetailView

I've based my app on Apple's SplitView project type. I have a TableView as the Master, and am using different types of views as the Detail view. To select types of detail view, I'm using the fancy concept of buttons on my DetailView toolbar. When the DetailView is derived from UIViewController, everything is good. When the DetailView derives from UIViewController, but contains a UITableView then I have problems. In portrait view the toolbar is visible. In landscape mode the toolbar is hidden, even though the Tableview is moved down to allow space for it. The UIToolbar and UITableView are both defined in my NIB file which is loaded to create the detail view. Why is my toolbar invisible in landscape?
BTW, is this the best way to choose Detail view types with UISplitView? Bonus question, what if selecting a row in my DetailView tableview should bring up another View, I can't push it like I would with a NaviagtionController, so how do I go back to the detail tableview?
Thanks, Gerry
HI Gerry,
I have faced the same toolbar problem, when trying to rotate the splitView, toolbar will disappear. If you are creating the toolbar in the interface builder, try to set the toolbar properties(size), by selecting the toolbar, then --> Tools -->Size inspector, in the autosizing section, mark the left, right and upper red lines and unmark the bottom red line, then everything will works fine.
-Maria
Bonus question, I would create a UINavigationController in code, set it's rootcontroller to the DetailView tableview (self) and then push the new view on top of it.
When you react to the rotation change are you using the same view or a different one for the detail view? Seems like the new view may not contain an instance of the toolbar? Or the Tableview is covering it up because the landscape view has less vertical room than the portrait view. Are you resetting the height of the tableview to allow space for the toolbar within the 768 height when rotating to landscape?
Just a tip but whenever I run into odd things like this I remove the elements from the NIB file and create them programmatically in code and it usually solves the problem. You get a lot more control over things when you do. Overall as I've gained more experience with programming for iPhone OS I've found that I rarely put much into a NIB file any longer and do almost everything in code now.

Resources