I would like for iPad that on portrait orientation shows only the MasterView of UISplitViewController, and on landscape show the both master view and detail view?How should I do?
the system is iOS 7.
As per my experience, Use UIViewController instead of using UISpiltViewController .
In this UIViewController have two UIView (1-UITableView and, 2-DeatilView subclass of UIView). Now have segue to DetailView from cell of UITableView . In UIViewController you can have TableView and DetailsView to display like SpiltView.
For LandScape and Portrait Resize the TableView.
Means Now you can customise according to orientation.
Related
My setup is a UINaviagtionController controlling a stack of UIViewControllers, with Portrait, Landscape Left and Landscape Right ticked
screenshot
I have ViewControllerA in portrait mode and add ViewControllerB either via a segue or via
[self.navigationController pushViewController:newMenuViewController animated:YES];
Whilst on ViewControllerB I rotate the device to landscape and then pop ViewControllerB, when ViewControllerA is displayed it is still in portrait mode with black covering the rest of the screen (I can only assume this is the UIWindow).
Screenshot
Can't seem to recreate the problem in a new project.
Any ideas?
Based on your screenshot, the View rotated but didn't resize... Check your constraints and/or autoresizing masks.
I am working on iPad landscape only version. I added splitViewController and assigned a viewController as detail view. I am using this view controller out side the splitViewController also as a full view viewController.
Problem : viewController is not resizing when its in splitViewController as detil view. i.e anyting which is on right corner of the view is out of visibel area.
P.S : I am using storyboard with autolayout ,Xcode 5.1
I solved by removing and adding back the view programmatically .
[self.segmentButtonBgView removeFromSuperview];
[self.segmentButtonBgView setTranslatesAutoresizingMaskIntoConstraints:YES];
[self.segmentButtonBgView setFrame:CGRectMake(self.segmentButtonBgView.frame.origin.x-158, self.segmentButtonBgView.frame.origin.y,405, self.segmentButtonBgView.frame.size.height)];
[self.view addSubview:self.segmentButtonBgView];
All subviews of segmentButtonBgView will resize if you have set constraints.
Is there anyway to rotate the UIViewController displayed on Storyboard as Landscape? By default it displays in a Portrait mode and wondering if there is anyway I can change that?
For iPhone app!
Select UIViewController on storyboard.
tap on Utitlies button at top right corner to show Utilities panel.
Select Attributes Inspector.
Under Simulated Metrics section, you can change Orientation of UIViewController to Landscape.
I would like to display a UITableViewController within a UIPopoverController, but the catch here is that I would like to have the UITableViewController displayed in a landscape orientation even though the viewController which is displaying the UIPopoverController is in portrait orientation.
If there is a way to set the orientation of a UITableViewController, that would be best, but I couldn't find a way to do this.
Any thoughts on how to do this would be appreciated?
I have a UITableview inside a popover. Initially the popover is displayed in portrait and upon rotation to landscape it disappears as expected. When rotated back to portrait and the popover is caused to be presented again, the tableview is shown in landscape mode inside the popover. How can I prevent the tableview from rotating, or cause it to rotate back?
Keep a reference to the popover in the view controller that opens it. That view controller will receive willRotate messages. You can dismiss the popover from there.