![](/img/trans.png)
[英]How do I constrain an SKShapeNode to the device edges in SpriteKit?
[英]How do I constrain this background to the edges of the screen programmatically
] 1
UIColor *background = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"giberWallpaper.png"]];
self.tableView.backgroundColor = background;
我在网上查看了如何限制背景的知识,并且看到了很多jargin,但是对于如何将屏幕的顶部,侧面和底部边缘的约束设置为0却一无所知。
在iOS 8上,您可以使用Visual Format Language 。 在iOS 9上,您还可以使用更新的布局锚点API。
这里有两种方法:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.