cthrp
cthrp

Reputation: 133

Change tableView:heightForRowAtIndexPath

I'm a bit confused on how I go about changing the UITableViewCell. Is this correct?

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath     *)indexPath
{
return 95;
}

If I need to explain more I can. Sorry if this is a dumb question, I'm new to iOS dev.

Upvotes: 2

Views: 352

Answers (4)

KDeogharkar
KDeogharkar

Reputation: 10959

set your table's datasource and delegate to File's owner from .xib.

enter image description here

Upvotes: 0

Kundan
Kundan

Reputation: 3082

first check you have declared table view delegate in .h file or not..

No need of declaring table view with property..

UITableView *tableView;

declare like this..

Upvotes: 0

borrrden
borrrden

Reputation: 33421

That code is fine, it is probably just not being called. You need to properly set the delegate property of the table view for this method to be called.

or

Since your heights are all the same, you can take a shortcut and set the rowHeight property of your table view.

Upvotes: 1

Kasaname
Kasaname

Reputation: 1501

this delegate will change the height of the table view cell

Upvotes: 0

Related Questions