0

I've seen a few apps (including Apple's) have a UITableView form where an image takes up 2 cell heights. How is this likely achieved? The example image below is the Venmo app.

Is the UIImageView just in the first cell, but made the height of 2 rows?

Venmo Example

user1218464
  • 1,011
  • 2
  • 12
  • 22

1 Answers1

0

It's just 1 custom cell with having one image at left hand side and two textfields at right hand side.

This custom cell's rowHeight will be 88 (double of normal cell rowHeight).

So you will need to create a custom cell and use it. These are some tutorial links which shows how to create custom cell using storyboards

http://www.appcoda.com/ios-programming-customize-uitableview-storyboard/

In a storyboard, how do I make a custom cell for use with multiple controllers?

Edit

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     if(indexPath.section == 0) {
         if(indexPath.row = 0) {
             // your custom cell here
         }
     } else {
         // your normal cell here
     }
}
Community
  • 1
  • 1
Yogesh Suthar
  • 30,424
  • 18
  • 72
  • 100
  • Thanks! I was wondering if it had to be a custom cell with 2 input fields. Since i'd seen this a number of times, I thought maybe there was a simpler way to do it. Making a custom cell means you have to handle the input different than if each cell had only 1 input. That adds some complexity if trying to standardize form creation. – user1218464 Nov 09 '14 at 03:16
  • @user1218464 Yeah, you have to handle custom cell differently then rest of the cells. – Yogesh Suthar Nov 09 '14 at 03:18
  • @user1218464 I have written demo code in answer, just check it. It shows how to handle your custom cell and normal cell. – Yogesh Suthar Nov 09 '14 at 03:22