Search code examples
iosuitableviewuiviewcontrollerscreen-rotation

tableviewcell does not stretch at landscape ie., orientation change


I need a fixed header that does not go from view. I intend to keep summary of tableview below. So I started off with a UIViewController and trying to put UIView and UITableView under that.

  1. In UIView I added a UIButton, UILabel but I'm running into layout constraints.

  2. In UITableView, when I change orientation cell is not filling up the view. why is that? Am a newbie to ios programming. Appreciate any pointers.

Pl see the images below.

enter image description here

enter image description here


Solution

  • Looks like You didn't pinned all your tableview edges with superview thats why this happened..

    select tableview and Pinned all edges of tableview with superview thats all..see below image

    enter image description here