objective c UITableView change row cell height
Posted by Eng.Ahmed AlSadiOct 13
xcode – iphone – objective-c
Hi;
the code below shows how to change UITableView ” table view ” cell or row height by using [ UITableView : heightForRowAtIndexPath ] ” Asks the delegate for the height to use for a row in a specified location “
|
1 2 3 4 5 6 |
//ExampleDB.com by AlSadi
//heightForRowAtIndexPath
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 50;
} |
or you can change cell “row” height by section number , or specific row
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
//ExampleDB.com by AlSadi
//heightForRowAtIndexPath
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
switch (indexPath.section) {
case 0:
switch(indexPath.row){
case 0: return 40;break;
default: return 35:break;
}
break;
case 1:
return 50;
break;
default:
return 45;
break;
}
} |
Related posts:
- objective c table view index of selected row cell Xcode – iphone – objective c Hi, to get index of selected section and row...
- objective c UITableView delete selected rows xcode – iphone – objective-c Hi; if you want to know my way of deleting...
- objective c UITableView delete all rows table view xcode – iphone – objective c Hi; the example below show how to delete all...
- objective c UITableView edit table view rows xcode – iphone -objective-c Hi; to edit ” delete or select ” rows or cells...
- objective c iPhone edit table view Xcode – iphone – objective c Hi, to edit table view UITableView you can easily...
Leave a Reply