简体   繁体   中英

Using Auto Layout in UITableView, Why is there so much extra space around?

My environment is XCode 6.3, Using the auto layout with UITableView, I always got the extra space between top Navigation and UITableView. have some idea can reduce it ? thank you.

在此处输入图片说明

You have not added Vertical Spacing for your TableView.

  1. Click on your tableView
  2. Editor > Pin > Top Space to Superview
  3. Click on Attribute Inspector
  4. Set constant to 0.

For your Button to show, remove all the constraints from your button and do the following:

  1. Select your button
  2. Editor > Pin > Leading Space to SuperView
  3. Select your button
  4. Editor > Pin > Top Space to SuperView
  5. Select your button
  6. Editor > Pin > Height
  7. Select your button
  8. Editor > Pin > Width

Try to increase your tableview height to 600 and make sure that you set the constraints according to it. It will solve your problem!

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