Friday, 15 January 2010

UICollectionView iOS8 Wrong Offset -



UICollectionView iOS8 Wrong Offset -

surprisingly, after updating ios8 app not behave in ios7. in particular, made calendar uicollectionview. in ios7 fine, month cells displayed correctly. in ios8...

i see offset toward top, that's cells shifted upward...i not understand, really.... code simple.

- (void)viewdidload { [super viewdidload]; uinib * nib = [uinib nibwithnibname:@"agendayearcollectioncell" bundle:[nsbundle mainbundle]]; [self.collectionview registernib:nib forcellwithreuseidentifier:agendayearcellidentifier]; [self.collectionview setdelegate:self]; [self.collectionview setdatasource:self]; uicollectionviewflowlayout *layout = [[uicollectionviewflowlayout alloc] init]; layout.minimuminteritemspacing = 0; layout.minimumlinespacing = 1; [self.collectionview setcollectionviewlayout:layout]; }

the collection not scrollable. if create scrollable, can scroll , see cells of first row. not want scrollable collection. think problem in inset. in fact, if play with:

- (uiedgeinsets)collectionview: (uicollectionview *)collectionview layout:(uicollectionviewlayout*)collectionviewlayout insetforsectionatindex:(nsinteger)section { homecoming uiedgeinsetsmake(40, 2, 50, 60); }

i can first row again. how calculate value screen/devices? app landscape , ipad. apple changed?

your collection view has negative top offset. providing more code help, let's seek first.

you called:

- (uiedgeinsets)collectionview:(uicollectionview *)collectionview layout:(uicollectionviewlayout *)collectionviewlayout insetforsectionatindex:(nsinteger)section

i not phone call unless want different insets different sections. looks have 1 section. configure flow layout:

flowlayout.sectioninset = cgsizemake(40.0, 2.0, 50.0, 60.0);

i recommend drop ios 7 support, devices ios 7 can upgraded 8.

how calculate value screen/devices?

should same offset ipad. if apple ship ipad bigger screen, offset same. if want universal app back upwards iphone set device status check , assign different numbers depending on device paradigm.

also, on top. did messed navigation bar? doesn't clear picture.

ios8 uicollectionview

No comments:

Post a Comment