How to adjust custom xib width of UITableViewCell according to device width
I am creating UITableTableViewCell
from nib file. I am using 320 width for the cell width. I found that when I run the application in the simulator iphone 6
, the cell cannot take up the full width of the table view. If I am using iphone 5s the width is just fine. I want to know how to adjust the xib width to fit different iPhone versions.
source to share
Have you enabled Use Auto Layout and Use Size Classes as shown below, as shown below, both in table view and table view. And tell me your problem
1) After that select an image and a label and do as shown below
2) Select an image and do below
3) select a label and do as follows
You can check the link below:
source to share
It seems like your table doesn't take up the full width of the screen. First, set the border as a table:
[[tblList layer]setBorderColor:[UIColor grayColor].CGColor];
[[tblList layer]setBorderWidth:2.0];
Check it out first. Then add a comment. In fact I am setting an auto-detection limit on my table view and keep the width of my custom one UITableViewCell
to 320. It automatically covers the full width of the screen.
source to share