I have an application that is divided into 4 quadrants, each quadrant is a view. Each view I have to fill it with a graph, for which I am using Core-Plot. I want when you touch a view appear a tableviewcontroller, but I cant do it. I have researched, but all I get is the ViewController in full view.
The idea is like this:
https://skydrive.live.com/redir.aspx?cid=a9f400f6a1d61745&resid=A9F400F6A1D61745!414&parid=root
I can't put the image because is my first post.
How could implement?
This is not the only TableViewController, because choosing an option leads me to another table view and so on to the data. There are 4 levels.
Thanks
I would create four navigation controller with the view controllers which manages the core plot view as root view controller. Than add the view property of the navigation controller to the main view ([mainView addSubview: [navigationController1 view]).
I don't know whether this works but I would try it this way.
Related
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.
Im writing an application which the main view controller is a UIViewController. It has some icons in a grid and I want to dismiss (sliding down) this grid when one of the icons is clicked. This I've done already. The problem is: when the grid is dismisseed I want another View to come from the top of the screen. This view is in this same root view controller. But I want to display the content of other view controllers in this view. For example: I want this view to show a UINavigationController with a UITableView inside it, so the user can navigate through TableViews.
I'm doing this:
HorariosViewController *horarios = [[HorariosViewController alloc] init];
[vuashView addSubview:horarios.view];
HorariosViewController is a UINavigationViewController. It shows me only a blue NavigationBar and changes like self.navigationItem.title = #"Title" won't work.
Thanks!
You can show another view controller's views as subviews but their outlets and actions remain linked to their original view controller unless you write code to make new connections, so self.whatever shouldn't be expected to affect the other view controller's properties.
(Also, if HorariosViewController is a UINavigationController, it shouldn't be created as a UIViewController.)
One approach is to have the navigation controller already there, with the icon grid presented modally on top of it. (you can set the view up this way without animations, so the user doesn't see the navigation controller underneath).
Then, when it's time for the grid to go away, it can call dismissModalViewController on itself with animation.
I have a scrollview that has a page control. The scrollview contains 3 views. Each view contains a view controller. In one of my view controllers I press a button and I want the scrollview to scroll to a specific location. But Im not sure how to accomplish that since the button is not in the UIScrollview but in one of the view controllers. Could anyone point me in the right direction with this? I have spent a lot of time trying to follow the view hierarchy to see if I can send a message to the scrollview for it to scroll. Any help is appreciated.
You can:
Add a delegate in your 3 inner View
Controllers that points to the View
Controller that holds your Scroll
View.
Create a method in the View
Controller that holds the Scroll
View that will call [scrollView
zoomToRect:] when called.
Access it from your 3 inner View
Controllers using the delegate.
If you need more information about delegation. check what is Delegate in iPhone?.
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 want a single startup view with a button and a welcome screen. When the button is pressed I then want to navigate to a second view which contains a table view and toolbar.
I've tried creating a ViewController but my button is shown on all views. I just want a single view, then when it's pressed i go to the next view and the 'real' app starts. Can someone please try and explain the best architecture to do this?
(like in chapter 6 of beginning iPhone 3 Development by Dave Mark and Jeff LaMarche )
Thanks
Are u developing for the iphone or ipad, if its for the iphone then have u looked into UINavigationControllers? These allow you to interchange from view controller to view controller in an easy fashion.
So for your problem I would have 2 view controllers one for the startup and one for the table view view controller. Assuming you set up the Navigation controller right (which you can easily by starting a new project with a navigation based viewcontroller through xcode), then you can use [navigationController pushViewController:viewCOntroller) method to present your view controllers view, also viewcontrollers have their navigationController as a property, so when the button is clicked all you should have to do it
new up the viewcontroller whose view you want to display
and call (from the current view controller ) [self.navigationController pushViewController:] method to display your second view controller.
release the view controller u just pushed
Navigation Controllers also have a navigationBar property which you can use to go back and forth between view controllers.. heres the class reference and it contains a guide of how to use these..Navigation Controller Reference