I'm new here and I just had a question about animating the trash can icon in an iPhone application like in the photo and mail app. I tried using the method here to animate the trash icon in a UINavigationController's toolbar, but it didn't seem to do anything.
Can anyone post a code sample of how to use this method correctly? Thanks
-(void)animateToolbarItemIndex:(NSUInteger)index duration:(NSTimeInterval)duration target:(id)target didFinishSelector:(SEL)selector;
There is no
-(void)animateToolbarItemIndex:(NSUInteger)index duration:(NSTimeInterval)duration target:(id)target didFinishSelector:(SEL)selector;
method in the official SDK docs. It's likely a private method. Are you working with the official SDK or jailbroken phones?
Related
I am looking for a great tutorial to implement a popoverview on iPhone all I found so far is talking about the ipad or is crashing
You cannot implement the UIPopover in iPhone.
Please refer UIElementGuidelines
For a nice popover tutorial check this site.
For popover in iPhone use the following Open source controls:
FPPopover
ModalView in iPhone
KGModal
MJPopupviewcontroller
UAmodalpanel
RNBlurmodalview
For more check this site
you cannot implement the standard popoverview in iphone. Have to make a custom view that replicate the popoverview.
Check these :
http://www.50pixels.com/blog/labs/open-library-fppopover-ipad-like-popovers-for-iphone/
This May help you great sample code you can find
https://github.com/takashisite/TSPopover
https://github.com/kyoshikawa/ZPopoverController
https://github.com/ddebin/DDPopoverBackgroundView
https://github.com/werner77/WEPopover
I know Apple recommends just placing the adview offscreen,
incase there is an error, loading an iAd,
but I would like to hide it using [adView setHidden: YES];.
If I do so, will the view check for new ads available?
In the simulator sure it will load the Test Ads,
but will it also work after releasing the app onto actual devices from the AppStore?
SideSwipe
Yes, it should work on real device.
I am currently working on an app with augmented reality. I chose to use the ARToolKit library (available on github).
I have a little problem to integrate my view in my project.
The problem is that I can not see my navigationbar when UIImagePickerController is launched
AugmentedRealityController.m
- (Void) displayAr
[RootViewController presentModalViewController: [self cameraController] animated: NO];
[DisplayView setFrames: [[[self cameraController] view] bounds]];
)
I guess the problem come from here. I can not view the UIImagePickerController that if I go through presentModalViewController.
By making a pushviewcontroller from my navigation controller it does not work either (after read documentation).
After some research on documentation should be implemented by the delegate access UIImagePickerController and UINavigationController. Even with that it does not work either (sniff).
I picked this version here: http://github.com/nielswh/iPhone-AR-Toolkit/commit/681165d383ab590d03a0daaf761bc25b59d1acd6
I adapted a few things so that his running iOS 4.1 (actually this version is 3.1.3).
I do not know if there have been changes regarding the use of UIImagePickerController since.
If anyone has an idea, help or something. After half a day searching the internet I try many things in vain
Issue summary
Changing the orientation of an iPad device or simulator while playing a video using MPMoviePlayerViewController results in an inconsistent rotation state upon dismissal of the video player. This is a known bug in iPad SDK 3.2, documented at http://www.openradar.me/8012810
Sample project
I have prepared a minimal sample project using the View-based Application template from Xcode 3.2.2, using the following code to launch the player
NSURL *movieUrl = [NSURL URLWithString:#"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"];
MPMoviePlayerViewController *player = [[MPMoviePlayerViewController alloc] initWithContentURL:movieUrl];
[self presentMoviePlayerViewControllerAnimated:player];
[player release];
The code is available on GitHub at http://github.com/adamalex/FullScreenMovie or direct download using http://github.com/adamalex/FullScreenMovie/zipball/master
Steps to reproduce
Obtain the project using the information above
Launch the project with the iPad simulator or device
Tap the button to begin playing the video
Rotate the iPad by 90 degrees
Dismiss the video
Note the UIStatusBar is out of sync with the application UI
Objective
I have contacted Apple and they have confirmed this is a bug that is being investigated. I would like to discuss temporary workarounds that use public APIs safe for submission to the App Store. I am going to open a developer support case with Apple as well and will report back with my own progress.
Successful response from Apple Developer Technical Support!
This is a known bug and a we're received a number of duplicate bug reports and so iOS engineering is aware of the issue and we do have a temporary workaround as suggested by iOS engineering.
You will need to implement this in the view controller which presents the movie player.
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
[self performSelector:#selector(fixStatusBar) withObject:nil afterDelay:0];
}
- (void)fixStatusBar {
[[UIApplication sharedApplication] setStatusBarOrientation:[self interfaceOrientation] animated:NO];
}
While this is somewhat ugly, it should fix the issue for now. It would be recommended to remove this code once the bug is fixed in the system.
This took care of the issue completely for me, and you can revisit http://github.com/adamalex/FullScreenMovie for the code with the fix applied.
This also solves an iPhone/iPodTouch rotation issue that I was struggling with. I am developing a universal app in which each view displays a different image depending on whether the device is in portrait or landscape orientation. Buttons are used to navigate between views.
If the app is running on the device and a portrait view is rotated to landscape, my image switching takes place. If the device is then placed flat on a table top and the button is tapped to display the next view, the view appears in landscape but shows the portrait image instead. I solved the problem by forcing a portrait view to appear by detecting for face up and down, but Apple's code solved this problem (as well as the similar movie problem I was also experiencing).
Many thanks for reporting the bug - I assumed it was just my bad coding...
I have been working around in UIImagePickerController and am struck with a problem where I need to get the precise moment when the camera shutter opens in UIImagePickerController when the source type is set to camera (UIImagePickerControllerSourceTypeCamera).
I have done some googling around and have realized that no one had such strange requirement!
I looked around the docs of UIImagePickerController and UIImagePickerControllerDelegate hoping to get some delegate method / callback indicating the camera shutter open event, but did not find any.
Any suggestions?
Thanks for any help,
Raj Pawan
Subscribe to:
AVCaptureSessionDidStartRunningNotification
This is when the iris open animation begins. If you add a cameraOverlayView during this time, it will be properly covered up by the iris. It is posted at the same time as that PL… private notification. This is a documented approach that does not risk app rejection.
The solution is to observe for a private notification, just as discussed in this thread:
Detecting when camera's iris is open on iPhone.
My sugestion (didn't try it myself but don't see why it wouldn't work) :
Subclass the UIImagePickerController class into your own class, and override the viewWillAppear and viewDidAppear : those methods will be triggered when the UIImagePickerController is about to appear or does appear (if you trigger its display properly using presentModalController for instance) .
#interface MyUIImagePickerController : UIImagePickerController {
}
#end
#implementation MyUIImagePickerController
-(void)viewWillAppear:(BOOL)animated {
NSLog(#"the picker is about to appear");
[super viewWillAppear:animated];
}
-(void)viewDidAppear:(BOOL)animated {
NSLog(#"the picker did appear");
[super viewDidAppear:animated];
}
#end