2012-03-24 3 views
0

단추 클릭 이벤트에 사용자 지정 팝업 메뉴가있는 사용자 지정 단추가있는 탐색 모음이 있습니다.이 메뉴에는 테이블 행 doselectrowatindexpath 메서드를 호출 할 때 테이블이 있습니다.탐색 표시 줄 이벤트 문제

나는이

여기

-(void)backButtonClicked1 



{ 


   // create and configure the view 
   CGRect cgRct = CGRectMake(220, 30, 93, 135); //define size and position of view 
    
   myView = [[UIView alloc] initWithFrame:cgRct]; 

   myView.backgroundColor=[UIColor clearColor]; 

   [myView setUserInteractionEnabled:YES]; 
    
     UIButton *btnpop=[[UIButton alloc]initWithFrame:CGRectMake(0, 0, 93, 140)]; 
    
    [btnpop setUserInteractionEnabled:YES]; 

   [btnpop setImage:[UIImage imageNamed:@"[email protected]"] forState:UIControlStateNormal]; 

   [myView addSubview:btnpop]; 
    
   //[self.navigationController.navigationBar bringSubviewToFront:myView]; 

 // [myView release]; 
    
  
   table = [[UITableView alloc]initWithFrame:CGRectMake(1,20,90,114) 

style:UITableViewStylePlain]; 

   [table setUserInteractionEnabled:YES]; 

   table.backgroundColor = [UIColor clearColor]; 

   table.separatorColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"[email protected]"]]; 

   table.scrollEnabled=NO; 

   table.layer.borderColor = [UIColor clearColor].CGColor; 

   table.layer.borderWidth=1.0; 

   table.layer.cornerRadius = 4; 

   [table setDataSource:self]; 

   [table setDelegate:self]; 

    
   [myView addSubview:table]; 

   myView.autoresizesSubviews = YES;   
   //allow it to tweak size of elements in view 
    
   [self.navigationController.navigationBar addSubview:myView]; 

   [self.navigationController.navigationBar bringSubviewToFront:table]; 

    
 } 
+0

내가 didselectrowatindexpath에 대해 아무것도 표시되지 않습니다, 업로드하는 신경 구현하세요? –

답변

2

코드를 입력 해결하십시오이 코드를 사용하고 당신은 대응하는 .m 클래스에서이

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 
    // Do your code here... 

} 

방법을 추가해야합니다.

1

delegate = self & datasource = self로 작성 했으므로 델타 & 데이터 소스 메서드를 해당 자체 클래스에 작성한다고 가정합니다.

당신 제공된 코드에

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 
    // Do your code here... 

}