1.創建View
leftView = [[UIView alloc] initWithFrame:CGRectMake(-400, 80, 400, Kscreenheight-80)];
2.點擊Btn,View從側邊滑入頁面,或滑出頁面
if (leftshow == NO) {
leftshow = YES;
[self.view addSubview:leftView];
[UIView animateWithDuration:0.3 animations:^{
leftView.frame = CGRectMake(8, 80, 400, Kscreenheight-80);
} completion:^(BOOL finished) {
if (finished ==YES) {
}
}];
}else {
leftshow = NO;
[UIView animateWithDuration:0.3 animations:^{
leftView.frame = CGRectMake(-400, 80, 400, Kscreenheight-80);
} completion:^(BOOL finished) {
if (finished ==YES) {
[leftView removeFromSuperview];
}
}];
}