Here is the question
I need to create a panel that apear on the app by clicking on the naviagationItemRightBarButton.
this panel contains labels btn etc...
I tried to do it using a UIPopover but I think that only works for ipad app.
public UIPopoverController CustomPopover;
FilterSortController newpanel = new FilterSortController();
//FilterSortController is UIViewController
CustomPopover = new UIPopoverController(newpanel);
CustomPopover.PresentFromBarButtonItem (this.NavigationItem.RightBarButtonItem , UIPopoverArrowDirection.Any, true);
and after that I overried the ViewDidLoad of the FilterSortController
ContentSizeForViewInPopover = new System.Drawing.SizeF(320,110);
There is no way to create a Popover for iphone using monotouch.
thanks for the help
UIPopoverController is not supported on iPhone. You would have to write your own custom controller and view to get this functionality. There is a open source implementation in ObjC here which you could btouch or port.
Related
I have a newbie question about integrating two iOS apps. I have created an app in iOS 5 (my first app so I dont have any knowledge of iOS 4 except the fact thah there were xibs files instead of storyboard and also ARC was not included).
Now I have to include one older standalone app (built for iOS 4 with xibs and non ARC) to my iOS 5 app. Lets say that in my app on Main menu view there will be a new button opening the main menu of the other app.
So I did some research and find out how to disable ARC by the fno-objc-arc flag. Fine, now I have imported all the files of the second app to mine app and all the classes have the flag set.
I can still run my app without problem.
Now I have no idea how to let my new button to open the mainViewController of the old app - this app has MainWindow.xib (contains a window and one navigation controller). This MainWindow is set to be Main Interface in the old project. There are also some init call in appMainDelegate file. Where can I call them in my app?
Could anybody tell me what needs to be done. I have an idea, that I will add only one new UIViewController to my storyboard. This will be the starting point for the old app and than everything will work as it used to. Or will I have to create more controllers (for every xib) in my storyboard? This is where I dont know what to do. Any help much appriciated. thank you
Try doing something like the following, anything like it or simmular should work:
In the method of the button (the one you call your new button) have it execute the following code:
OldAppMainViewController *controller = [[OldAppMainViewController alloc] init];
//Here you can assign vallues to any properties that you might want to
[self.navigationController pushViewController:controller animated:YES];
That old apps main view controller should have a init with nub named function so it should work. If this does not work try something along the lines of:
OldAppMainViewController *controller = [[OldAppMainViewController alloc] initWithNibName:#"OldAppMainViewController" bundle:nil];
Where the NIB name is the .xib file name without the extension.
Also make sure that all connections in interface builder is setup correctly
I am using wikitude API for augmented reality in my iPhone app. But I got stuck in implementing that in my application.
I am having one button in my one View on clicking of which I want to open the Wikitude AR view but I am not able to add it over that view.
As in Sample application provided by Wikitude this wikitudeAR view is added over the Main window but in my application I want to add the view([wikitudeAR Start]) over my view like(self.view addSubview:[wikitudeAR Start]) which is not working.
Please suggest me.
Thanks in advance
This might solve your problem
after you have added wikitude to the subview, call the following method
[wikitudeAR show];
You must add the Wikitude View as a subView of the key Window.
Then, you can show or hide it using the "show" and "hide" methods.
The code is:
- (void) verificationDidSucceed {
[[[UIApplication sharedApplication] keyWindow] addSubview:[wikitudeAR start]];
}
How can I handle different views in XCode?
Let's say I want to show a different view when the user press a button.
UIViewController *viewSettings;
[viewSettings initWithNibName:(NSString *)#"SettingsViewController" bundle:(NSBundle *)nil];
This code don't work. The app crashes.
I have updated my XCode to the new version. How can I say my projects that they have to take the new SDK?
Thanks.
This is the correct line. Then you need to push it (pushViewController) onto a UINavigationController or add it to an existing view. Do a Google search for iPhone Beginner Tutorial First Application or something like that.
UIViewController *viewSettings = [SettingsViewController initWithNibName:#"SettingsViewController" bundle:nil];
1) You use a UIViewController to manage the view stack and ultimately which view is visible.
2) In your xCode project, modify the project or target "Base SDK" property. This will let you choose the minimum version of iOS to require of your users.
You need to read the Apple documentation for view controllers There are also some very good beginner books out there for iPhone programming
I'm a newbie programmer and I have played around with the SDK for a while. How do you create a homepage that has a button that will bring you to another view (the content of the app)??? If you know can you list the steps in order or link a tutorial site (It woul be awesome if the steps had code with it I needed). Thanks!
I would recommend getting a good book on iPhone programming. What you want to do is set up a UINavigationController, add the button to the first view, set the action of the button's touchUpInside to call the showContent method. Then implement the showContent method to push the Content view controller.
- (IBAction) showContent{
ContentViewController *myContentController = [[ContentViewController alloc] init];
myContentController.title = #"Content";
[self.navigationController pushViewController:myContentController animated:YES];
[myContentController release];
}
Have a read up on the documentation for pushViewController and UINavigationControllers, then follow this tutorial.
I used a utility application template to create my application, but I am using a UIImagePicker to pick some photos. The little infoButton, the i with a circle around it, shows up when the picker is displayed. If the infoButton was not in another class then I could call infoButton.hidden = YES; and it would hide it. Any ideas how to solve this problem?
Thanks,
-Pat
I took a look at the utility application template, the view controller with a gray background and an info button is MainViewController, and the instance is also the "mainViewController" property of the application delegate.
It seems that you have already created an IBOutlet to the infoButton, so, you can access the button by calling [UIApplication sharedApplication].delegate.mainViewController.infoButton .