简体   繁体   中英

IOS UITableView right half cut off screen

For some reason, no matter what I do, when I create a static tableview inside a UITableViewController, put content into the cells and run the simulator the right half of the screen is always cut off and I don't know why. Ive tried making new projects and remaking the storyboard but nothings working.

Here's what it looks like when I run the app

在此处输入图片说明

heres what the storyboard looks like. 在此处输入图片说明

I have content set to static cells

Anyone run into this problem or know how to fix it via storyboard (or programmatically but not preferred)?

Update:

Here are some more pictures of what another project looks like when I run it:

在此处输入图片说明

and here's what the storyboard looks like

在此处输入图片说明

You need to give constraints to your right button...

For that select your button and pin its edges to right, top, bottom and give width constraint like below

在此处输入图片说明

and here is autolayout tutorial link .. you can check that

I see the problem in giving constraints to the table not for the button. Try giving constraints to the table like "leading space to superview,trailing space to superview,top space and bottom space to superview

Edit: The above solution given by me might fix for tableview inside UIViewcontroller.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM