क्या आपको कोई समाधान मिला है?
मैं UICollectionView के लिए समान सुविधाओं को लागू करने की कोशिश कर रहा हूं।
अब तक अनुभाग इंडेक्सटाइटल के लिए मैं मूल UICableView का उपयोग मूल UICollectionView के समान अनुभागों के साथ कर रहा हूं, लेकिन खाली कोशिकाओं के साथ। एक परिणाम के रूप में मैं एक IndexTableView वर्ग
indexTableView = [[IndexTableView alloc] initWithFrame:CGRectZero];
[self.view addSubview:indexTableView];
...
indexTableView.frame = CGRectMake(CGRectGetWidth(self.view.frame) - 40, 0, 40, CGRectGetHeight(self.view.frame));
indexTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
indexTableView.sectionHeaderHeight = 0;
indexTableView.backgroundColor = [UIColor clearColor];
मैं UICollectionView के शीर्ष पर IndexTableView जोड़ने है, और एक मूल UITableView रूप में एक ही दृश्य प्रभाव मिला है। अब मैं इंडेक्स चयन और यूआईसीओलेक्शन व्यू को जोड़ने और इसे काम करने की कोशिश कर रहा हूं।
संपादित: मैं सिर्फ UICollectionController
- (void)viewDidLoad
{
[super viewDidLoad];
...
self.searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, self.collectionView.frame.size.width, 44)];
self.searchBar.autocorrectionType = UITextAutocorrectionTypeNo;
self.searchBar.delegate = self;
[self.collectionView addSubview:self.searchBar];
[self.collectionView setContentOffset:CGPointMake(44, 0)];
}
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {
if (section == 0) {
return UIEdgeInsetsMake(CGRectGetHeight(self.searchBar.frame), 6, 0, 6);
}
return UIEdgeInsetsMake(0, 6, 0, 6);
}
मुझे भी इस पर एक अच्छा जवाब चाहिए; यदि संभव हो तो मैं एक और टेबल दृश्य छिपाने से बचना चाहूंगा (स्मृति समस्याएं)। –