0
我想將GMGridView添加到我的筆尖文件中的子視圖,但我似乎無法弄清楚如何執行此操作,因爲GMGridView一直在使用在我的筆尖生成的視圖中的所有空間,並涵蓋了一切。將GMGridView添加到子視圖,以便它不佔用所有屏幕
這是我想(粘貼只是部分代碼,以使其更具可讀性):
- (void)viewDidLoad {
[super viewDidLoad];
_gmGridView.mainSuperView = self.gridView;
}
- (void)loadView {
[super loadView];
self.view.backgroundColor = [UIColor whiteColor];
NSInteger spacing = INTERFACE_IS_PHONE ? 10 : 15;
GMGridView *gmGridView = [[GMGridView alloc] initWithFrame:self.gridView.bounds];
gmGridView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
gmGridView.backgroundColor = [UIColor clearColor];
[self.gridView addSubview:gmGridView];
_gmGridView = gmGridView;
_gmGridView.style = GMGridViewStylePush;
_gmGridView.itemSpacing = spacing;
_gmGridView.minEdgeInsets = UIEdgeInsetsMake(spacing, spacing, spacing, spacing);
_gmGridView.centerGrid = NO;
_gmGridView.actionDelegate = self;
_gmGridView.dataSource = self;
}
這是正確的做法,或者我應該創建另一個筆尖與GMGridView,並將其添加到我的子視圖?
在此先感謝任何人!