I was searching information to show a uiwebview using a flip horizontal effect like modal transition one in viewDidLoad event, but I wasn't successful, even in apple documents. Can anybody help me with that?
Many thanks
the transition to animate webView with the view add your webView like this.
[UIView transitionWithView:poster.view duration:3
options:UIViewAnimationOptionTransitionFlipFromLeft animations:^{
[self.view addSubview:yourWebView];
}
completion:NULL];
The animation you want to add can be done on the UIView. So you should addSubView the UIWebview to the UIView and then do the animation on the UIView.
Related
I would like to display an image as an animation that will just glance to the screen and then disappear after 1 or 2 seconds.
It should be a layout above my already existing WKWebView.
I was looking everywhere how to do it but couldn’t configure it out.
Thanks in advance!
In your viewController scene in storyboard, add a UIImageView on top of everything and attach your IBOutlets (or through code in viewDidLoad) and load your image. For example your UIImageView *splashImageView.
Then use this code in your viewDidAppear method:
[UIView animateWithDuration:1.0f // this is a duration param
options: UIViewAnimationCurveEaseOut
animations:^{
[self.splashImagaView setAlpha:0.0f];
}
completion:^(BOOL finished){
}];
For more details read here
Hope this helps.
I've got the button on the fullscreen UIImageView and I want to pinch this view on that button press. I mean, I want to show only the part of the UIImage to the fullscreen after the button is pressed. Which method should I use?
Basically you can just start a zoom Animation, if that is all what you want.
Example:
[UIView animateWithDuration:1.0 animations:^{
yourView.transform = CGAffineTransformMakeScale(2.0,2.0);
}];
Put your UIImageView inside a UIScrollView to get zooming and panning.
See this SO post. I've already used this technique and it's the only way I know to do it.
you will want to use the pinchGestureRecognizer :)
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIPinchGestureRecognizer_Class/Reference/Reference.html
I need to present and then dismiss a UITableView modally. It should animate in from top to button. But it should not cover the whole screen, it will slide in from under navigation bar and stop before it reaches the tabbar.
So i can't use the presentViewController:animated:completion: for its view controller.
I need to manipulate it as part of a view hierarchy. The question is, where should this table view be when it is not visible. Where will I animate it from?
You could put the UITableView inside a UIView and use animateWithDuration. For example (using some made up dimensions):
[subMenuView setFrame:CGRectMake(5,-400, 310, 400)];
[UIView animateWithDuration:0.8f
delay:0.0f
options:UIViewAnimationOptionTransitionCurlDown
animations:^{
[subMenuView setFrame:CGRectMake(5,0,310,400)];
}
completion:^ (BOOL finished)
{
if (finished)
{
//animation has finished, you can do something here, even another nested animation
}
}];
If you want to then slide it back up, do the opposite...
This is how I switch from one UIView to another UIView: self.view = MyView;
How would I fade out a view to my MySecondView?
You can use UIView's build in transition code to cross dissolve between them.
[UIView transitionFromView:self.view toView:MySecondView duration:0.25 options:UIViewAnimationOptionTransitionCrossDissolve completion:^(BOOL finished) {
// What to do when its finished.
}];
You can also use the regular animation options with something like this. I haven't tested this code as I'm not in front of Xcode but I use it all the time for labels and things without default animations.
[UIView animateWithDuration:0.25 animations:^{
[self.view setAlpha:0.0];
self.view = mySecondView;
[self.view setAlpha:1.0];
}];
Please note that it's not a good idea to do things like self.view = MyView to change screens. By the time you get to a few screens, your viewController will be filled with spaghetti code. You should consider presenting new view controllers that manage their views. One way you can do fade is as follows:
Fade the current view to black (with animation)
In the view controller that you are going to push use viewWillAppear to fade the view to black as well
Push/Present the view controller without animations.
Now use the viewDidAppear method of the newly presented view controller to fade in the view (with animation).
CGRect rect = CGRectMake(0, 0, 1050, 900);
[wineAdminPopup presentPopoverFromRect:rect inView:master.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
Hi I put the above code to make a popup in a tableview. However it doesn't popup in the whole screen. If I want to center it in the iPad screen with no arrow or arrow in the center. How can i do it. Thanks in advance.
The rect parameter in presentPopoverFromRect:... specifies the rectangle at which to anchor the popover, not the size of the presented popover. That would be specified by setting contentSizeForViewInPopover on the popover's content view controller.
If you don't want the arrows and don't need the specific behavior of popovers, then you could
present your view controller modally:
controller.modalPresentationStyle = UIModalPresentationFullScreen; // or UIModalPresentationFormSheet
[self.navigationController presentModalViewController:controller animated:YES];
presentModalViewController is deprecated in iOS 6 and above. Use presentViewController:yourViewController animated:YES completion:nil (parameters animated and completion can be set depending on your requirements). Also if you want to resize yourViewController you need to change self.view.frame and next time your view controller will be of that size.