วันอังคารที่ 5 มีนาคม พ.ศ. 2556

Add UIView Slider Down


lbView.backgroundColor = [UIColor blackColor];
    lbView.frame = CGRectMake(0, 0, 320, 480);
    lbView.alpha = 0.7;
    UIButton *removeLbView = [UIButton buttonWithType:UIButtonTypeCustom];
    removeLbView.frame = CGRectMake(0, 0, 320, 480);
    [removeLbView addTarget:self action:@selector(removeShareLocationTapped) forControlEvents:UIControlEventTouchUpInside];
    [lbView addSubview:removeLbView];
    [self.view addSubview:lbView];
    self.myLocationView.frame = CGRectMake(0, -400, 320, 480);
    [self.view addSubview:self.myLocationView];
    
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.5];
    self.myLocationView.frame = CGRectMake(0, 0, 320, 400);
    [UIView commitAnimations];


- (void)removeShareLocationTapped {
    [lbView removeFromSuperview];
    
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.5];
    self.myLocationView.frame = CGRectMake(0, -400, 320, 400);
    [UIView commitAnimations];

    
}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น