, 당신은 비트를 프로그램 할 필요가, 당신은 내가 도움이되기를 바랍니다,
//Adding Delete Tap Gesture
-(void)addGestureToSubViews{
for(UIView *view in parent.subviews){
UITapGestureRecognizer *gesture=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(deleteAction:)];
[view addGestureRecognizer:gesture];
}
}
-(IBAction)deleteAction:(UITapGestureRecognizer *)sender{
UIView *view=sender.view;
[UIView animateWithDuration:.3 animations:^{
CGRect rect=view.frame;
rect.origin.x=view.superview.frame.size.width;
view.frame=rect;
} completion:^(BOOL finished) {
[self reArrangeSuperView:view.superview withDeletedViewFrame:view.frame];
[view removeFromSuperview];
}];
}
-(void)reArrangeSuperView:(UIView *)superView withDeletedViewFrame:(CGRect)frame{
for(UIView *view in superView.subviews){
CGRect rect=view.frame;
if(rect.origin.y>frame.origin.y){
rect.origin.y=frame.origin.y;
}
[UIView animateWithDuration:.3 animations:^{
view.frame=rect;
}];
}
}
이것을 달성하기 위해 다음 코드를 시도 할 수 있습니다.
건배.
정말 도움이되는 사람 ... 고마워요. – svmrajesh
보기 A를 제거하면보기 B도 제거됩니다.보기 B 높이가 너무 깁니다. – svmrajesh
이 수정을 위해 if (rect.origin .y> frame.origin.y)'. 당신의 필요에 따라. .. – iphonic