Я использую xib для создания пользовательской ячейки. Я хочу отображать метку, в зависимости от текста ярлыка. Как увеличить высоту строки, а также высоту надписи?Как увеличить высоту строки в iphone?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
customCell *cell=(customCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[NSBundle mainBundle]loadNibNamed:@"customCell" owner:self options:nil]objectAtIndex:0];
UIImage *userimage=[self getUserImage:[userimageURLS objectAtIndex:indexPath.row]];
cell.userImageViewIv.autoresizesSubviews=YES;
cell.userImageViewIv.image=userimage;
cell.userNameLbl.text=[UserName objectAtIndex:indexPath.row];
cell.commenttxtlbl.text=[postText objectAtIndex:indexPath.row];
NSLog(@"cell created");
}
return cell;
}
Переменный массив посттекста не является статическим. Это динамично.
Я использовал приведенный выше код.
Что вы пишете в heightForCell? – Nirmalsinh
Если его> = iso7 ссылается на это ** - tableView: оцененныйHeightForRowAtIndexPath: ** https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableViewDelegate_Protocol/Reference/Reference.html # // apple_ref/occ/intfm/UITableViewDelegate/tableView: measuredHeightForRowAtIndexPath: – CoolMonster