ios - UICollectionView fixed Content Size -
i'm trying create keyboard extension using uicollectionview (i try use uibuttons keyboard take long time load i'm trying use collection view maybe better).
my questions are:
- what better: have better responsiveness, should use xib or code ?
- my principle issue can't fix content size of collectionview layout can't fix height of cell (direction == uicollectionviewscrolldirectionvertical)
here's how i'm trying fix cell height:
- (cgsize)collectionview:(uicollectionview *)collectionview layout:(uicollectionviewlayout*)collectionviewlayout sizeforitematindexpath:(nsindexpath *)indexpath { return cgsizemake(self.keyboardcollectionview.frame.size.width/keys_in_section.count, self.keyboardcollectionview.frame.size.height/sections.count); }
using code width correct not height (this cause direction == uicollectionviewscrolldirectionvertical)
for first question both gives same responsiveness, if use storyboard designing easy.
for second one
http://www.raywenderlich.com/78550/beginning-ios-collection-views-swift-part-1
just go through link. may helps you.
Comments
Post a Comment