Is it possible to display 4 rows instead of default 3 rows in the TTLauncherView?
Asked
Active
Viewed 1,065 times
2 Answers
1
You can modify the row height with a category if you always use the same number of rows:
@interface TTLauncherView(FourthRow)
@end
@implementation TTLauncherView(FourthRow)
- (CGFloat)rowHeight {
int rows = 4;
return round(_scrollView.height / rows);
}
@end

jverdi
- 1,506
- 13
- 14
0
For me, the default number of rows in TTLauncherView was 4, so I'm not sure why you're seeing only 3. Or do you mean columns (which does default to 3)?
Either way both values are configurable via the columnCount and rowCount properties:
TTLauncherView launcher = [[[TTLauncherView alloc] initWithFrame:self.view.bounds] autorelease];
launcher.rowCount = 3;
launcher.columnCount = 3;
should give you one with both 3 rows and columns

Andrew Flynn
- 1,501
- 12
- 17
-
Hi Andrew! In TTLauncherView.h is rowCount defined this way => @property(nonatomic,readonly) NSInteger rowCount; As far as I know it is impossible to alter a readonly property ;) – Daniel Dec 02 '10 at 10:14
-
Daniel, you are right, rowCount can not be altered as it is calculated automatically based on the columnCount. If you set columnCount to 4, you should have rowCount of 4 (depends on the size of the icons for each launcher, you should take this into account) – Hoang Pham Dec 06 '10 at 13:43
-
Okay, it seems to be impossible to get this done the easy way. The rowHeight is calculated this way => round(_scrollView.height / 3) somewhere internal the TTLauncherView. Even subclassing TTLauncherView and returning the height valid for 4 lines does not change anything. – Daniel Dec 06 '10 at 16:49
-
Odd, you're right about it being readonly. I thought I had tried this out before posting it. I don't have it set up with me so can't try it now, but I'll give it another look next week and see. – Andrew Flynn Dec 09 '10 at 08:49
-
Yeah so I tried it out and it doesn't allow me to set it (readonly prop) so I'm not sure why I thought it worked initially. But on the other hand, when I added a bunch of icons to my launcher page it filled up 4 rows. Are you sure you're only getting 3? columnCount definitely isn't readonly, so with the combination of changing columnCount and adding the icons to specific pages, you should be able to get it to look the way you want. If you set columnCount to 4 and add >=13 icons, it doesn't do 4 rows? – Andrew Flynn Dec 15 '10 at 07:06