sql
php
css
c
xml
ajax
python
mysql
linux
objective-c
multithreading
silverlight
json
perl
tsql
apache
mvc
postgresql
dom
Set the frame of your scrollView to the bounds of your cell before you add it.
So
self.scrollView.frame = cell.bounds; [cell addSubview:self.scrollView];
Debug... NSLog.... output the frames of things so you can see where they are getting positioned as opposed to where you want them to be positioned. Use this for outputting frame coordinates:
NSLog(@"Frame is: ", NSStringFromCGRect(self.scrollView.frame));
or define a nice shortcut, as I use this all the time
#define LogCGRect(rect) NSLog(@"CGRect:%@", NSStringFromCGRect(rect));
then you can just do
LogCGRect(self.scrollview.frame);
It just fits the scrollview into the tableviewcell, no matter if it's height is 44 or 90.
I solved my problem using this code:
cell = [tableView dequeueReusableCellWithIdentifier:ScrolledCellIdentifier]; if (cell == nil) cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ScrolledCellIdentifier]; cell.frame = CGRectMake(0, 0, 320, 90); self.scrollView.frame = CGRectMake(0,0, 320, 90); [cell addSubview:self.scrollView];
i don't know if it's wrong but it works...