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]];
}
Related
i am currently developing an ios app that uses PayPal's Mobile Payment Library to facilitate payment of goods.The Problem is that Paypal generates a web view that set to portrait -Upright mode. This is to my knowledge is generated inside the payPal library and i can't see anyway to acces it . Is there anyway to make te web view rotate in landscape mode.After some extensive searching i found that most everyone are just using the portait mode ,is there anyway to make it rotate to landscape.
Actually there is a way to manually rotate the checkbox view of paypal in iOS. This view is an instance of PayPalViewClass. Just add a method to look through all the views and all the subviews to find the instanse of this class. Once you've found the view you was looking for just apply setTransform method to it.
The method should look like like this:
-(void)cicle:(UIView *)aView {
for (UIView *_v in [aView subviews]) {
if ([_v isKindOfClass:[NSClassFromString(#"PayPalViewClass") class]]) {
[aView setTransform:CGAffineTransformMakeRotation(-M_PI/2)];
}
[self cicle:_v];
}
}
It should be called in your payWithPayPal method.
I hope this helps ;)
I am having the same problem.
Since PayPal is adding its view to the key window and not the root view controller, then it ignores the device orientation.
There are many questions here that explain the landscape orientation issue, when adding a subview directly to a window, for example:
UIInterfaceOrientation always return Portrait in AppDelegate iPad?
I am trying to catch PayPal UIView and rotate it manually, but not figured out if it is possible yet.
For Paypal library v1.6.0, the PayPalViewClass is in view hierarchy of application's main window.
You just need to call method provided by #alex and pass your app's delegate window.
To get the window [[[UIApplication sharedApplication] delegate] window] is enough.
Put the call after you call -advancedCheckoutWithPayment: or -checkoutWithPayment:.
If you allow all orientations, you will need to transform the PayPalViewClass accordingly to device orientation.
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.
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
In my app, I want to implement admob and now only I have started to learn about it. So any one please guide me and is there any nice tutorial or sample?
It's extremely simple. Follow the guide here: http://developer.admob.com/wiki/IPhone#AdMob_iPhone_SDK
Once you have the SDK up, you simply do:
AdMobView *ad = [AdMobView requestAdWithDelegate:<your delegate>]; // start a new ad request
ad.frame = CGRectMake(0, 432, 320, 48); // set the frame, in this case at the bottom of the screen
[self.window addSubview:ad]; // attach the ad to the view hierarchy; self.window is responsible for retaining the ad
Download the Admob SDK for iPhone and look at the example projects. It's very simple.
If you choose to use the Interface Builder approach and follow their steps
there is one step missing: Add an AdViewController object to your UIViewController.h/m file and use that as the referencing object in IB. Otherwise you'll get the error:
"Must implement required method
-currentViewControllerForAd:(AdMobView *)adView in your delegate"
I realize this is a basic assumption, but it caught me for a minute and i've implemented AdMob 3 times in the past (using different methods, mind you).
Add an ad to a view using Interface Builder
Add AdViewController.h and AdViewController.m to your project (located in the IBSupport subdirectory).
Open Interface Builder.
Place a 320x48 UIView where you want the ad to appear.
Add an Object, and change its type to AdViewController.
Set the view outlet of the AdViewController to your UIView.
Set the currentViewController outlet of the AdViewController
to the UIViewController owning the xib.
Edit AdViewController.m to make sure that your publisher ID and
other options are set correctly.
Good thing to know, Mike. They also left out one step in Interface Builder. You need to select File's Owner, and drag from Ad View Controller to the new Ad View Object. I simply cannot comprehend why Admob would leave out these details, especially when many new programmers join they're community all the time. They really need help in the documentation & tutorials department.
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.