Obj-C, Is there a transition effect which will work with both modal and none modal views?
I'm trying to make a modal view and a non modal 开发者_如何转开发view appear the same.
The modal view is a library I'm using.
I want to use the same transitional effect on both, is there one I can use ?
No for ModalView Controller you have your standard Animate: YES, and NO, this just shifts it up, or DOWN (if you dismiss Modal View contreoller)
my technique is building UIView's into the same xib/nib and using the 6 animations that are offered on that for a really cool effect. in the end you can tie the UIVIew up in another new class (NewView), and add that class object to your xib and tie up the buttons etc...
header...
@interface NewView : UIView {
IBOutlet UIView *mynewView;
}
@end
implmentation... for say a button)
-(IBAction)openThisPage{
[UIView beginAnimations:nil context: NULL];// Setting up the Animation
[UIView setAnimationDuration:1.0]; // Duraction
[UIView setAnimationTransistion:110 forView:self cache: YES]; // Type of Animation
[otherUIVIEW removeFromSuperview]; // removes UIView to Screen
[self addSubView:otherUIView]; // adds a UIView to screen
[UIView commitAnimations]; //creates the animation
}
other naimations as you can see i said 110 for one of those animations, 110 = bubble effect animation
UIViewAnimationTransistionFlipfromLeft = Flip from Left Side, change Left ot Right for right side
UIViewAnimationTransistionCurlDown = Curls the page from Top to Bottom, put Up for opposite effect
103 = Genie Effect
also their is a couple more using the camera roll, but no user's use that unless they are leaving or entering the camera roll, I have not touched them myself....
what do you mean a library you are using, like a Core Data UITableView ?
building it with UIViews I have noticed is always alot easier, easier for manipulation with on screen effects, creating simple drill down file menu's
so basically create a new class, with no XIB, name it hwatever, change the class implementation delegate to UIView, add a view to that new class
go into your main XIB, add a Object, change it's properties to that new class, and then tie up new buttons and create a UIView in that XIB and tie it to that class, and you are good to go :-)
I could post code, but I dont really have a solid example on this computer... let me know if this helps....
精彩评论