2013-04-08 36 views

回答

1

你應該繼承UICollectionReusableView,將你的插座添加到子類中,修改故事板中標題視圖的重用標識符,並從數據源實現collectionView:viewForSupplementaryViewOfKind:atIndexPath。檢查蘋果文檔。

例如:

-(UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath{ 

HeaderView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HeaderView" forIndexPath:indexPath]; 

//set the delegate of the textfield to the view controller 
headerView.textField.delegate = self; 

return headerView; 
} 
+0

你可以給我的代碼或例子嗎? – Naveen 2013-04-08 13:06:01

+0

類似的東西 – ragnarok 2013-04-08 13:14:17

+0

:你有樣品代碼嗎? – Naveen 2013-04-08 13:24:20

相關問題