tableview - xcode horizontal table like app store -
i have attempted create table within table cell present of horizontal table cell slide of app store.
if go app store , click featured products tab see mean.
a nested horizontal slide table.
i have downloaded 1 works vey internet seems use nibs. looking create 1 using storyboard feature. reasoning find easy use when doing segues etc
i have come far in having 1 complete cannot seem resize cells fit (i.e., cells width height of rotated table)
here of code copied downloaded source
the table
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; tableviewcell *cell = (tableviewcell*)[self.tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cgaffinetransform rotatetable = cgaffinetransformmakerotation(-m_pi_2); tableviewcell.horizontaltableview.transform = rotatetable; tableviewcell.horizontaltableview.frame = cgrectmake(0, 0, tableviewcell.horizontaltableview.frame.size.width, tableviewcell.horizontaltableview.frame.size.height); tableviewcell.contentarray = [arrays objectatindex:indexpath.section]; tableviewcell.horizontaltableview.allowsselection = yes; //cell = tableviewcell.horizontaltableview; } return cell; } the table cell
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; uitableviewcell *cell = [self.horizontaltableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstylesubtitle reuseidentifier:cellidentifier] ; } (uiimageview *view in cell.subviews) { [view removefromsuperview]; } cgaffinetransform rotatetable = cgaffinetransformmakerotation(-m_pi_2); horizontaltableview.transform = rotatetable; horizontaltableview.frame = cgrectmake(0, 0, horizontaltableview.frame.size.width, horizontaltableview.frame.size.height); tableviewcell.contentarray = [arrays objectatindex:indexpath.section]; horizontaltableview.allowsselection = yes; uiimageview *imageview = [[uiimageview alloc] initwithframe:cgrectmake(0, 0, 30, 30)]; imageview.image = [contentarray objectatindex:indexpath.row]]; imageview.contentmode = uiviewcontentmodecenter; cgaffinetransform rotateimage = cgaffinetransformmakerotation(m_pi_2); imageview.transform = rotateimage; [cell addsubview:imageview]; return cell; } allow me explain problems incurred: - cell==nil not work cell not seem nil; - cell = tableviewcell.horizontaltableview commented out because uitableview datasource must return cell tableview:cellforrowatindexpath error - cell rotation seems work have in table cell section seems problem have cannot resize it
if me code or point me site has working storyboard nested horizontal table appreciated.
(bear in mind yet called professional in app development stretching boundaries trying pull off)
Comments
Post a Comment