2013-06-01 2 views
-2

다음 코드는 내가 다시 클릭 할 때보기를 표시하는 데 사용한 코드입니다. 정상적으로 작동하지만 더 이상 숨기지 않고 더 이상 숨기지 않고 단순히 전망.클릭하여 UI보기 및 숨기기 클릭 문제

- (IBAction)didTapFlag:(id)sender 
{ 
checkBtnCondition=YES; 
menuView.hidden=YES; 
if([audioPlayer isPlaying]) 
{ 
    [self playPauseAudio]; 
} 
if(iscommentOn==NO) 
{ 
    [mCommentView hide]; 
    iscommentOn=YES; 
} 
else 
{ 
    iscommentOn=NO; 
     if(iscommentOn) 
     if(![commentPlayer1 isPlaying]) 
      { 
      iscommentOn=NO; 
      } 
     if(!iscommentOn) 
      { 
      iscommentOn=YES; 
      if(mCommentView) 
      { 
       [commentPlayer1 stop]; 
       commentPlayer1 = nil; 
       [mCommentView hide]; 
       return; 
      } 
      float comx; 
      float comy; 
      if(UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad) 
      { 
       comx = 200; 
       comy = 280; 
      } 
      else 
      { 
       comx = 50; 
       comy = 170; 
      } 
      mCommentView = [[CommentUtility alloc] initWithFrame:CGRectMake(comx, comy, 330, 250)]; 
      [mCommentView setDelegate:(id)self]; 
      [self.view addSubview:mCommentView]; 
      [mCommentView show]; 
     } 
     } 
    } 

내 코드에서 변경해야 할 사항, 내 코드에 문제가있는 사항. 제발 도와주세요.

+0

당신은 당신의 문제를 해결 했습니까? – Bhavin

+0

예. 문제가 해결되었습니다. –

답변

1

샘플 코드 :

- (IBAction)didTapFlag:(id)sender 
{ 
    int btnTag = ((UIButton *)sender).tag; 
    if (btnTag == 0) 
    { 
     [yourView setHidden:YES]; 
     yourButton.tag = 1; 
    } 
    else 
    { 
     [yourView setHidden:NO]; 
     yourButton.tag = 0; 
    } 
}