Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-21-2009, 08:58 AM   #1 (permalink)
New Member
 
Join Date: May 2009
Location: Fredericton, New Brunswick, Canada
Posts: 21
emansfield is on a distinguished road
Default Different sized cells in grouped table view

Is it possible to have different sized cells in different sections of a UITableView configured as "grouped"?

I have tried creating two different UITableViewCell objects in Interface Builder, one for each section in my table view, but both cells show up as the same size - the size of the first cell created.
emansfield is offline   Reply With Quote
Old 05-21-2009, 11:14 PM   #2 (permalink)
Reena
 
Join Date: Apr 2009
Posts: 31
reena is on a distinguished road
Default

Quote:
Originally Posted by emansfield View Post
Is it possible to have different sized cells in different sections of a UITableView configured as "grouped"?

I have tried creating two different UITableViewCell objects in Interface Builder, one for each section in my table view, but both cells show up as the same size - the size of the first cell created.


using
- (CGFloat)tableViewUITableView *)tableView heightForRowAtIndexPathNSIndexPath *)indexPath
method you can solve your problem

eg.

- (CGFloat)tableViewUITableView *)tableView heightForRowAtIndexPathNSIndexPath *)indexPath
{
if(indexPath.row == 0)
return 40;
else if(indexPath.row == 1)
return 85;
return 35;
}
reena is offline   Reply With Quote
Old 05-22-2009, 07:12 AM   #3 (permalink)
New Member
 
Join Date: May 2009
Location: Fredericton, New Brunswick, Canada
Posts: 21
emansfield is on a distinguished road
Default

Quote:
Originally Posted by reena View Post
using
- (CGFloat)tableViewUITableView *)tableView heightForRowAtIndexPathNSIndexPath *)indexPath
method you can solve your problem
}
Thanks Reena, I actually discovered that method for myself yesterday and everything works fine now. I was trying to adjust the size of the cells themselves rather than looking at the delegate methods.

Last edited by emansfield; 05-22-2009 at 07:14 AM. Reason: Remove extraneous [/INDENT] line
emansfield is offline   Reply With Quote
Old 06-05-2009, 11:57 AM   #4 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 2
jees is on a distinguished road
Default

Hi emansfield, I also try the work that you've done. The delegate's method, heightForRowAtIndexPath, didn't work in my side, and I want to implement a method do the job instead of the delegate's method. Could you pls show me some tips?

Quote:
Originally Posted by emansfield View Post
Thanks Reena, I actually discovered that method for myself yesterday and everything works fine now. I was trying to adjust the size of the cells themselves rather than looking at the delegate methods.
jees is offline   Reply With Quote
Old 06-11-2010, 11:03 PM   #5 (permalink)
Senior Member
 
Join Date: Feb 2010
Location: dallas
Posts: 219
gud4nuthin is on a distinguished road
Default this method is not working

its not working when user press the tab and go to net view

in my main view its working but not after that
any idea??
gud4nuthin is offline   Reply With Quote
Reply

Bookmarks

Tags
uitableview, uitableviewcell

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 338
6 members and 332 guests
givensur, ipodphone, jbro, mer10, n00b, yomo710
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,881
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:08 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0