简体   繁体   English

如何将约束设置为tableView到viewController中?

[英]How to set constraints to a tableView into a viewController?

I'm trying to place a tableView in a viewController, but im not able to constraint properly the tableView, i'm doing the usual things, i'm sticking the leading, trailing and bottom constraints to superview, and some space to the top superview. 我试图将tableView放置在viewController中,但无法正确约束tableView,我正在做平常的事情,我将前导,尾随和底部约束保留在superview上,并将一些空间保留在顶部监督。 But as shown in the preview, table view does not look to be constrained, the effect that it brings for me is that when i put elements into content view, they extend along the right side i can not see them for small devices. 但是,正如预览中所示,表视图似乎不受限制,它为我带来的效果是,当我将元素放入内容视图时,它们沿右侧延伸,对于小型设备,它们看不到它们。 Does anyone know what could be happening? 有人知道会发生什么吗?

Thanks in advance! 提前致谢!

StoryBoard Tree 故事板树

After spending long time checking what happened i figured out that there is a Xcode fail on it, i run it in simulators and real devices and it works perfect, the bad thing is that everything i inserted into that view does not look as it should in the preview, but again, in simulator everything works fine. 在花了很长时间检查了发生了什么之后,我发现Xcode失败了,我在模拟器和真实设备中运行了它,并且效果很好,可惜的是,我插入该视图中的所有内容看起来都不像预览,但同样,在模拟器中,一切正常。 So, preview is not always as trusty as i expected and now i know it 因此,预览并不总是像我期望的那样可靠,现在我知道了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 设置ViewController的约束 - Set Constraints for ViewController presented 以编程方式在 ViewController 中设置 tableView - Set tableView in a ViewController programmatically 在 ViewController 中设置 TableView 和 collectionView - Set TableView and collectionView in ViewController 如何在ViewController上调整TableView的大小 - How to resizing tableview on viewcontroller 如何在目标C中将图像从主viewController设置为tableView单元格? - How to set image from main viewController to tableView cell in objective C? 如何将静态TableView添加到ViewController - How to add static TableView to ViewController 如何使用复杂的TableView设计ViewController - How to design a ViewController with complex TableView 如何在TableViewController上向TableView添加约束? - How to add constraints to TableView on TableViewController? 当在 Swift 5 中点击 Tableview Row 时,如何使用 Xib(不是 StoryBoards)在 SideMenu Controller 中设置 UINavigationController 以推送新的 ViewController - How to set UINavigationController in SideMenu Controller using Xib (Not StoryBoards) to push new ViewController when Tableview Row Tapped in Swift 5 如何正确地将信息从TableView隔离到ViewController - How to correctly segue information from TableView to ViewController
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM