我一直在研究一個包含ECSlidingViewController項目的應用程序,使我可以從左側滑入導航。導航鏈接是在一個NSArray並使用下面的代碼段動態地顯示成UITable:調整UITable /單元格寬度
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *cellIdentifier = @"MenuItemCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
cell.contentView.backgroundColor=[UIColor blueColor];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier];
}
cell.textLabel.text = [self.menuItems objectAtIndex:indexPath.row];
return cell;
}
的問題是,該文本是太長的長度來顯示,一旦我們查看出控制器的幻燈片。現在看起來是這樣的:
我很想能夠減少單元格的寬度,如果這是可能的,甚至是文本拆分成兩行,使它看起來更像是這樣的:
任何有用的建議將不勝感激!
此作品在一定程度上...我可以調整新UITableView,儘管我的表不再由我的NSArray填充。有任何想法嗎? –
你需要確保UITableView的數據源和委託仍然適當設置我猜? –