i need to have 2 kinds of rows. One with 44 px of height and other with 90px:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0)
return 90.0;
else
return 44.0;
}
The problem is when i called - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath because i need to add to the cell with 90px an scrollView that have 90px of height but it's added on the middle of the cell instead on the top.
if (indexPath.section == 0) {
cell = [tableView dequeueReusableCellWithIdentifier:ScrolledCellIdentifier];
if (cell == nil)
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ScrolledCellIdentifier];
//cell.textLabel.text = @"hi";
[cell addSubview:self.scrollView];
}
Trying to set the textLabel of the cell works, the problem is adding the scrollView.
If i add this line to the code:
self.scrollView.frame = CGRectMake(0,-45, 320, 90);
It works perfectly but it sounds some weird for me. What is happening?