I downloaded the Collection View example and I replaced the ImageView with textfield. I want to make the textfield as big as the UICollectionViewCell (which is a square shape). But the shape of the textfield didn't change.
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
static NSString *identifier = @"Cell";
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
// height and width in the parent cell
double height = cell.frame.size.height;
double width = cell.frame.size.width;
// get the child textfield
UITextField *textField = (UITextField *)[cell viewWithTag:100];
// make the textfield as big as the cell
CGRect frame = CGRectMake(0, 0, width, height);
textField.frame =frame;
textField.text = @"testing";
return cell;
}