I am having an issue when im using navigation controller. My program is laid out where I have a start screen (not in the navigation controller) and then when you press a button it sends you to the navigationController and new view.
How can I call the navigation controller from the start screen?
Pushing a view controller will only work if the view controller pushing is contained in a navigation controller. You can try to hide the navigation bar in the pushed view controller: how to hide navigationbar when i push from navigation controller?
If you still want to keep your structure, the possible solution would be to present the navigation controller with table view controller as a modal. You need to use the presentViewController:animated:completion: method in the start view controller:
[self presentViewController:theTableViewController animated:YES completion:nil];
in AppDelegate.h class
Create a property of UINavigationController like:
#property (strong,nonatomic) UINavigationController *navigationController;
and in give it as a RootViewController in AppDelegate.m like:
self.navigationController = [[UINavigationController alloc]initWithRootViewController:self.viewController];
and give it to Window like:
self.window.rootViewController = self.navigationController;
Thats it!!! You are Done!!
Now you have navigationController at the root as well.
Cheers!!
If you don't have any problem in adding first controller to UINavigationViewController then do the following to do this just from interface builer :
1) Select first view controller in storyboard.
2) From menubar select Editor -> Embed In -> Navigation Controller.
Related
I want to use UIActivity view controller,When i click on sharing button then share sheet open...
I want to make a separate UIActivity controller class using callBack method.and how we use in another view controller class
(Snapshoots are here for more details)
i got this : a combobox in the main view and 3 tabs that use the combobox to load their store.
The files Mathrice*.js describe the whole view and the others (in directories) are the tabs.
My question is if there is a way to get the combobox in the tabs controller
If your combobox has an ID as displayed below
Ext.create('Ext.form.ComboBox', {
id: 'mycombobox',
renderTo: Ext.getBody()
});
Then you can get the combobox component anywhere in the controller using:
var cb = Ext.getCmp("mycombobox")
//note the name is the id of the combobox
//here cb will be the combobox instance that you need.
Solution :
Just need to to understand how viewModel works in sencha (cf sencha doc)
In tab's controller, i tried to get the parent controller which contains the combobox and then i play like i'm in that view.
Below the controller of one tabs
,mathrice : this.getViewModel().getParent().getView().getController()
,init:function () {
console.log(" VPN Tab Controller");
var me=this
,selectALab = me.mathrice.lookupReference('comboboxLab')
}
If the combo and tabs are under different controllers, there's no need for the tabs controller to be aware of the combo. You want to have the combo's controller fire an event when the combo's change that you are interested in happens. The tabs controller should listen to this event and take action. This approach reduces coupling and makes your app more maintainable.
I'm working on a client project that uses UIPageViewControllers.
The app has a hierarchy of "collection" view controllers that the user navigates through to get to (in this case) a page view controller that contains pages of content.
My design is to have the hierarchy of "collection" view controllers be custom subclasses of UIViewController that know how to manage collections of child view controllers with the client's desired UI.
My view controller that displays a page view controller is a subclass of my parent collection view controller, and that parent view controller class might manage page view controllers, cover-flow style view controllers, table view controllers, or a variety of others.
Ok, so I can't make my view controller that manages a page view controller a subclass of both my parent view controller and of UIPageViewController.
This is an iOS 6 project, so I decided to make my view controller contain a page view controller using an embed segue. That handles the housekeeping of parent/child view controllers painlessly, or so I thought.
However, the client wants a page curl transition in the view controller, and it seems that you can't change the transition of a page view controller after initializing it, nor can you specify the navigation orientation, spine location, etc.
Hmm. Seems I am in a catch 22.
Does anybody know of a way to use an embed segue to embed a page view controller as a child of another view controller and control the settings you get with initWithTransitionStyle:navigationOrientation:options: ?
At this point I might need to abandon the embed segue and manage the parent/child view controller relationship manually, which is a fair amount of work, especially when you deal with forwarding auto-rotation and other messages from parent to child.
Ok, problem solved.
There ARE settings in IB for a UIPageViewController that let you control the transition style, navigation orientation, and options.
The problem is that when I created a container view in my parent view controller, IB created a generic UIViewController as the child and I changed it's type to UICollectionViewController. When I did that the settings stayed those for a generic UIViewController.
I had to delete the generic child UIViewController that IB created, drag a UIPageViewController scene into the storyboard, then control-drag from the collection view onto my new UIPageViewController and select "embed" as the type of segue I wanted. When I did THAT, it gave me the settings I needed.
I am using a splitviewcontroller template. From the detail view I am navigating to a different view controller using a SEGUE. The problem is the new view only displays in the detail view part of the split view. I want the new view to cover entire screen or a way to completely remove master view (when new view is pushed) and push master view back later. How can i do that ?
some code examples would be helpful.
You can implement this delegate method to conditionally hide the master view:
- (BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController (UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation
{
return YES;
}
I am new to iOS programming. I am quite amazed at the power and ease of collection view. But I have a problem.
I have a "home" view controller - A, which is UICollectionViewController. I have a left button (like Facebook on the navigation bar) and I redirect to another view controller using
[self.navigationController pushViewController:controller animated:YES];
When the user presses the back button, the "home" view controller appears. And viewWillAppear and other collection view delegate/datasource methods are called. but table is frozen. It does not scroll, do anything.
But if on the left button i press the "home" button, then viewWillLoad and other methods are called and the collection view works.
I do not have any code in viewWillLoad. I have moved everything to viewWillAppear to test.
Please help