Фиксированная высота для UITableViewCell - PullRequest
0 голосов
/ 12 июня 2011

У меня есть UITableView, и я хочу, чтобы каждая ячейка была фиксированной высоты в 50 пикселей, как это можно сделать в Xcode4?

Вот мой просмотр таблицы, загруженный из файла XIB

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }

1 Ответ

6 голосов
/ 12 июня 2011
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
     return 50;
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...