하나의 단추가있는보기를 표시하고 있습니다.이 단추를 클릭하면 Objective C에 정의 된 애니메이션 방법을 통해 PopUp보기가 표시되고 팝업보기에 이미지가 추가됩니다. . 다음 뷰의 모든 탭에서 너비와 높이를 0으로 설정하여이 팝업보기를 숨기고 있지만 그 위에있는 이미지는 숨어 있지 않습니다. 어떻게 숨길 수 있습니까? 이러한 관점에서 탭 접촉을 한 후에 애니메이션을 통해보기 위에 내용을 숨기는 방법
-(void)btnImageClkForPopUp:(id)sender
{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2.5];
popup_viewforimage.frame=CGRectMake(8, 30, 300, 250);
popup_viewforimage.backgroundColor=[UIColor whiteColor];
UIImageView *imgview=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 300, 250)];
imgview.image=[UIImage imageNamed:@"apple.jpeg"];
[popup_viewforimage addSubview:imgview];
[self.view addSubview:popup_viewforimage];
[UIView commitAnimations];
}
이러한 두 가지 방법
이 숨길라고이 방법은 버튼을 클릭 한 후 호출 .. 내가 사용 방법 ..이다
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
if ([touch.view isKindOfClass:[UIButton class]])
{
return NO;
}
return YES;
}
-(void)hidekeyboard
{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2.5];
popup_viewforimage.frame= CGRectMake(15, 65, 0, 0);
popup_viewforimage.backgroundColor=[UIColor grayColor];
[self.view addSubview:popup_viewforimage];
[UIView commitAnimations];
}