2011-10-18 4 views
0

쉬운 문제는 알고 있지만 셀을 내 tableview에 그룹화 할 수는 없습니다. 옵션을 "그룹화"로 변경했는데 작동하지 않습니다.TableView의 그룹 셀

어디에서 문제가 될 수 있습니까?

파일 소유자와 연결되어 있으며 속성이 있으며 IBOutlet이 있으며 일반 TableView로 표시됩니다.

미리 감사드립니다. 모든

답변

1

먼저 당신이 탐색 기반 응용 프로그램 및 오픈 RootViewController.xib을하고 RootViewController.m 파일 의 TableView 속성에서 속성을 선택 스타일의 그룹 후에 가서 응용 프로그램을 실행

// Customize the number of sections in the table view. 
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 
    return 5; 
} 


// Customize the number of rows in the table view. 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 
    return 10; 
} 

-(void)setListTableView 
{ 
    mytableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 59, 319, 358) style:UITableViewStyleGrouped]; 
    mytableView.separatorStyle = UITableViewCellSeparatorStyleSingleLineEtched; 
    mytableView.backgroundColor = [UIColor clearColor]; 
    mytableView.opaque = NO; 
    mytableView.delegate = self; 
    mytableView.dataSource = self; 
    mytableView.scrollEnabled = YES; 
    mytableView.scrollsToTop = YES; 
    [self.view addSubview:mytableView]; 
} 
+0

문제가 있다는 것입니다 NavigationController 내부의 새로운 ViewController에서 TableView를 프로그래밍하고 있습니다. 그것이 내가 효과가 없다고 말하는 이유입니다. 나는 새로운 프로젝트에서 그것을 해냈다. 그리고 그것은 작동한다, 그것은 그룹화 된 세포를 보여준다. 왜 그것은 내 UITableViewController에서 작동하지 않습니다 ?? 어쨌든 귀하의 답변 주셔서 감사합니다. – agapitocandemor

+0

내 업데이트 된 코드 확인 –

+0

좋아, 그게 내가 찾고 있던거야 : 'initWithStyle : UITableViewStyleGrouped' – agapitocandemor

관련 문제