Not Getting any Idea on how to solve this ....
Ok. This is my custom UITableViewCell
with three different Child Views. That you can see with different colors.
Here , Height of my second Child View is dynamic and be calculated at run time. I am using -heightForRowAtIndexPath
to set the height of UITableViewCell
.
What I have tried :
I set the Outlets of Child Views and then in -heightForRowAtIndexPath
, I used this Code...
middleView.frame = CGRectMake(0, 60.0, 750.0, size);
footerView.frame = CGRectMake(0, size + 60.0, 750.0, 50.0);
where, size = Dynamically Calculated Height of Middle View.
UPDATE :
I have also tried with static value of size like this ...
middleView.frame = CGRectMake(0, 60.0, 750.0, 350.0);
footerView.frame = CGRectMake(0, 350.0 + 60.0, 750.0, 50.0);
But No Luck at All....
Size is calculated by this : size = (elements * 30) + 50;
where , elements = Number of elements in the Array.
Problem :
Look, at the Screenshot.
Any Suggestions ?
To solve this problem you have to do two things
set proper autoresizingMask to all your child views
return proper height from UITableViewDelegate method
Set your middle view and footer view frame in following method instead of heightForRowAtIndexPath:
and keep your other method as given by indra Mohan above.
}