Jumpman987
Jumpman987

Reputation: 317

Tableviewcell has custom view, not sizing correctly while app is running (Pictures below)

I've attempted to create a cardview effect in my iOS app, seems to be working except that when the app runs the tableview cell is way smaller than expected and I have no idea why. The cell's height is set at 75, and the uiview used for the cardview correctly connects to its super view. This cuts off the bottom half of the cell for some reason, which has important information like date of birth and zip code.

I'll post a link to some pictures below, anyone think they can see what I'm doing wrong or have any ideas on how to fix it? first[![][1]second3[third]4

Upvotes: 0

Views: 34

Answers (1)

guarinex
guarinex

Reputation: 122

Cannot tell per what you posted if you are indeed setting the cell height. It seems it is missing the correct height you want. For that you use:

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {

     //for example if you want a fixed size
     //here you can also do some math and apply a percentage of the screen height depending of the iPhone version.

     return 75
}

Upvotes: 1

Related Questions