Wednesday, 15 June 2011

uicollectionview - Android like view pager with tabs on iOS -



uicollectionview - Android like view pager with tabs on iOS -

i know best way implement android view pager tabs on ios 1 found on fifa world cup app

the various approaches think of were:

customised uitabbarcontroller swipe , pan gesture- tried , swipe experience not fluid fifa app. sluggish new skype app (think using approach). page view controller- tried ran unusual issues. did not seek much after that. collection view controller horizontal paging- seemed best approach me, not sure memory management.

my current implementation- have 3 tab bar entries of now. have separate view controllers each of them. here way implemented using horizontal paging collection view:

- (uicollectionviewcell *)collectionview:(uicollectionview *)collectionview cellforitematindexpath:(nsindexpath *)indexpath { nsinteger indexnumber = indexpath.row; uicollectionviewcell *cell; switch (indexnumber) { case 0: cell = [collectionview dequeuereusablecellwithreuseidentifier:@"collectionviewcell1" forindexpath:indexpath]; [cell.contentview addsubview:self.firstviewcontrollerobject.view]; break; case 1: cell = [collectionview dequeuereusablecellwithreuseidentifier:@"collectionviewcell2" forindexpath:indexpath]; [cell.contentview addsubview:self.secondviewcontrollerobject.view]; break; case 2: cell = [collectionview dequeuereusablecellwithreuseidentifier:@"collectionviewcell3" forindexpath:indexpath]; [cell.contentview addsubview:self.thirdviewcontrollerobject.view]; break; default: break; } homecoming cell; }

i not figure out way manage cells improve made different entities. how can improve approach or if approach not should use?

ios uicollectionview uitabbar

No comments:

Post a Comment