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;
}
謝謝,解決了它:) –