0
我在我的应用程序中使用了GMGridView。当我改变方向时一切都很好,但是如果我再次改变它并进入编辑模式,除了右下角的可见单元之外,所有的单元格都在晃动。 GmGridView作为子视图添加到控制器中,它也不占用整个屏幕。我已经尝试销毁它并在发生旋转通知时重新创建它...相同的行为。此外,我使用GMGridViewCell的contentView设置了多个按钮和标签来定制视图。GMGridViewCell不摇晃
这里的cellForItemAtIndex
- (GMGridViewCell *)GMGridView:(GMGridView *)gridView cellForItemAtIndex:(NSInteger)index {
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
GMGridViewCell *cell = [gmGridView dequeueReusableCell];
if (!cell) {
CGSize cellSize = [self GMGridView:gmGridView sizeForItemsInInterfaceOrientation:orientation];
cell = [[GMGridViewCell alloc] initWithFrame:CGRectMake(0, 0, cellSize.width, cellSize.height)];
cell.deleteButtonIcon = [UIImage imageNamed:@"delete_button"];
cell.deleteButtonOffset = CGPointMake(0, 0);
}
CustomGridViewCell *gridViewContent = [CustomGridViewCell getNewGridViewCellForOrientation:orientation];
ContentData *data = [wishlistContentArray objectAtIndex:index];
[gridViewContent setuprWithContent:data];
cell.contentView = gridViewContent;
if (!gridViewContent.delegate)
gridViewContent.delegate = self;
return cell;
}
谢谢,解决了它:) –