Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make the customized UITableViewCell xib width to fit the device width

I am creating a UITableTableViewCell from a nib file. I am using width of 320 for the the cell width. I found when I run the app in iphone 6 simulator, the cell cannot occupy the whole width of the table view. If I use iphone 5s, the width is just fine. I want to know how to adjust the width of the xib to fit to different iPhone versions.

like image 337
mmjuns Avatar asked Jun 20 '15 07:06

mmjuns


1 Answers

Did you enable the Use Auto layout and Use Size Classes as below do that first in both table view and table view cell .and tell me your problem

enter image description here

1)After that select both image and label and do as below

enter image description here

2) Select the image and do below

enter image description here

3) select the label an do the following

enter image description here

Can you check the link below:

iOS - Custom table cell not full width of UITableView

like image 161
Nischal Hada Avatar answered Nov 08 '22 11:11

Nischal Hada