I had used the UIPageViewController. This type of Controller will take up the entire Page Of VC to display with the 3 dots at the bottom.
I have been searching on internet for customize UIPageViewController with no success.
This is my problem:
in a VC:
1) Display UIPageViewController at the Top so there is space to display other UI in the middle and bottom of VC.
How to display UIPageViewController in a fixed size,say, 320 x 240 with 3 dots (indicators) immediately below the display image in a VC?
Thanks
To put a UIPageViewController's view anywhere you like in the interface, make it an embedded view controller. In other words, you have a parent view controller and a child view controller, where the page view controller is the child. There are strict rules about how to implement a custom parent-child relationship, but if you do it according to the rules, the frame of the page view controller's view is then completely up to you.
Related
I'm trying to pop up a view controller from the bottom of the screen but I want a view from its parent view controller to show on top of it so that it slides up from underneath this view. There's no interactivity with this extra view on top of everything. Is there a reasonably simple way to do this?
There are various ways to achieve this:
You can create a xib and add over the view controller.
You also create a programmatically view and add over the VC.
You also can drag view over the VC in storyboard and initially hide the view.
Show with the animation.
I am having trouble to find out the best way of transitioning only a part of view controller.
This is what I have:
In my first view controller, I have a UIView that acts like a header where I provide some ImageViews and Labels, bellow it I have a table view.
When user clicks a cell from the table, another view controller is pushed and it contains the same UIView header as before and bellow it some detailed information about the cell item selected.
This is what I want:
Since both view controllers have the same UIView header, I would like it to be fixed and only change the bottom contents (table view or detailed informations). I expect a transitioning effect that only move the contents on the bottom.
I appreciate any guidance.
A View controller controls views, so it isn't a case of transitioning view controllers, you can do this by transitioning views.
You can have multiple views. that occupy portions of the window.
In your case you could keep the top view (the one that you call the header) and when you need to change a part of the view your controller just needs to create a new view to display and then you can animate it into it's new position on top of the old view.
UIView animations let you accomplish this. For example, you could use transitionFromView:toView:duration:options:completion: to animate from your table view to the detail view.
It is possible to have a different view controller for this detail view if you want. All you need to do is create the view controller with the information that is needed to configure its view, and then pass this view as the toView to the above method, and then when you are done with the view, you can use the same method to transition back to the original tableview.
I have an app built from the UITabBarController starter project. The first tab is part of the main.xib that contains the tab bar. I would like to slide a view up from the bottom on top of that tab's view that only covers part of the screen. My understanding is that you can only cover part of the screen if you make the top view non-modal, but I don't see a way to do that without a NavigationController.
How can I do this?
you can add a UIView as a subview to the current view, and then animate its appearance into the screen using animation blocks, or Quartz or however you would like.
presentModalViewController: is actually a method that belongs to UIViewController, the superclass of UINavigationController, so you can use it from any view controller, not just a navigation controller.
Have you tried using a UIActionSheet? That's an easy way to get a view with a few buttons for user input to slide up and only cover the bottom portion of the current view.
My app is using a navigation controller and it has a navigation bar, a table view and an image on each view. Those elements layout from top to bottom with no overlapping.
Now because I have the exactly same image for every view (a logo), is it possible to animate only the navigation bar and the table view while the views push and pop? I want the logo always stays on the screen.
Thanks in advance.
Interesting idea. You might try adding the view directly as a subview of the navigation controller's view, rather than making it part of any of the controllers it manages—in that case, you probably also want to give the view a particular tag, then retrieve a reference to it in your individual controllers' -viewWillAppear:animated: and call -bringSubviewToFront: with it on the navigation controller.
I have a main view which has 3 labels positioned on the top. At the bottom there are about six buttons. On tapping each of the buttons, a different view is to displayed in the center area.
Each of those views have a view controller of its own. In the viewdidload method I set the view frame's y position and height so that it fits in the center area.
This all works if I add those views as subviews. But I want to maintain a view hierarchy. So I tried to use navigation controller. But the problem is the main view goes off screen and the child view is positioned from the top.
How do I solve this problem?
Do you mean the navigation controller supports adding of subviews without taking off the parent view from the screen?