進口QuartzCore框架和ü希望什麼樣的出現從底部像ios7控制中心的窗口做到這一點
- (void)viewDidLoad
{
upwardView=[[UIView alloc]init];
upwardView.backgroundColor=[UIColor blueColor];
UISwipeGestureRecognizer *gesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(didSwipe:)];
gesture.direction = UISwipeGestureRecognizerDirectionUp;
[self.view addGestureRecognizer:gesture];
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
-(void)didSwipe:(UIGestureRecognizer *)gestureRecognizer
{
[upwardView setFrame:CGRectMake(0, 265, 320, 230)];
CATransition *animation = [CATransition animation];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromTop];
[animation setDuration:.50];
[animation setDelegate:self];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
CALayer *layer = [upwardView layer];
[layer addAnimation:animation forKey:nil];
[self.view.window addSubview:upwardView];
}
是否認爲如下手指?或者在我滑過後呈現視圖?我在哪裏放第一塊代碼? viewDidLoad? – RMS
我在父ViewController中有一個UITableView,我怎樣才能限制滑動的區域?它似乎目前不起作用 – RMS
@RaphMaz -i已將滑動手勢放在tableviewcell上,如果你在單元格的下側滑動,那麼它將移動到下一頁 –