使用“跳出效果”UIView
self.dropDownBar
尽管设置了边界,但UIView
继续从屏幕底部掉落
表明:
addBoundaryWithIdentifier:fromPoint:尖山: P1 边界线段的起点。 P2 边界线段的终点。似乎是这样做的,
和Collision not working between items(没有接受的答案,没有合适的)
.h
<UICollisionBehaviorDelegate>
@property (strong, nonatomic) UIDynamicAnimator *animator;
.m
self.animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view];
UIGravityBehavior* gravityBehavior =
[[UIGravityBehavior alloc] initWithItems:@[self.dropDownBar]];
[self.animator addBehavior:gravityBehavior];
UICollisionBehavior* collisionBehavior =
[[UICollisionBehavior alloc] initWithItems:@[self.dropDownBar]];
//To - from boundries
[collisionBehavior addBoundaryWithIdentifier:@"NotificationBoundary" fromPoint:CGPointMake(0, 45)
toPoint:CGPointMake(0, 90)];
[self.animator addBehavior:collisionBehavior];
我在这里缺少什么?