Closed boozi2 closed 11 years ago
If you fork and branch out a version with the behavior you specify, I can pull and try see if I can diagnostic the issue. :)
lxcid, thanks for the fast reply !
my fork is here : https://github.com/boozi2/LXReorderableCollectionViewFlowLayout.git
Thanks for the help!
I went to do some debugging and found out that if the width and/or height is odd, the UICollectionView will display incorrectly, but if the width and/or height is even, the UICollectionView display correctly. This portion doesn't seems like something the library controls though, to me it seems like UICollectionView issue. If I set the UICollectionView layout to the default one, it still happening. I think a work around is just do an increment of 2.
Thanx lxcid, its a strange bug that the cell's measurements should always be even.. anyway the workaround does the trick !
thanx again for this great layout
hey everyone,
i love this reorderable flowlayout and i tried to use it in a project where im changing the cell sizes with a uislider.
everything works grate until the cells are reaching a size where they can fit only one per line.
then the following thing happens:
does anyone have any idea why this happens ?
to enable zooming i added the following code to the sample demo with the cards:
in LXCollectionViewController.h file
@property (strong, nonatomic) UISlider *zoomController; @property (nonatomic) CGFloat zoomLevel;
and in LXCollectionViewController.m file
-(IBAction)sliderValueChanged:(UISlider *)sender { self.zoomLevel = self.zoomController.value; [self.collectionView reloadData]; [self.collectionView.collectionViewLayout invalidateLayout]; }
(CGSize)collectionView:(UICollectionView )collectionView layout:(UICollectionViewLayout)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
return CGSizeMake(160 + self.zoomLevel, 240 + self.zoomLevel);
}
-(void) addZoomController { self.zoomController = [[UISlider alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - 50, self.view.frame.size.width, 50)]; [self.zoomController addTarget:self action:@selector(sliderValueChanged:) forControlEvents:UIControlEventValueChanged];
}
(void)viewDidLoad { [super viewDidLoad];
self.deck = [self constructsDeck];
[self addZoomController]; }