【发布时间】:2015-12-27 22:35:43
【问题描述】:
我在本质上翻转 UIView 以模仿卡片翻转时遇到了一点麻烦。
就目前而言,我在 XIB 中创建了两个 UIView(前视图和后视图)并将其加载到情节提要中:
//Initiate the view from the XIB
CustomClass *drag = [[CustomClass alloc] initWithFrame:rect];
//Add the view to the view (container) within the storyboard
[self.draggableView addSubview:drag];
在我的自定义类中如下:
-(id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
self = [[[NSBundle mainBundle] loadNibNamed:@"Draggable"
owner:self
options:nil] objectAtIndex:0];
return self;
}
这令人满意地呈现了前视图...
现在我无法确定如何翻转视图以在同一个 XIB 中显示另一个 UIView...此 UIView 在“objectAtIndex:1”处可用。
我很确定我需要的代码包括:
[UIView transitionWithView:UIVIEW
duration:0.5
options:UIViewAnimationOptionTransitionFlipFromBottom
animations: ^{}];
【问题讨论】:
-
我们做了什么?
标签: ios objective-c iphone xcode uiview