简体   繁体   English

Xcode图像属性检查器中对齐的目的是什么

[英]What is the purpose of alignment in Xcode image attribute inspector

I was fixing a problem related to image aspect ratio so just discovered the alignment property in attribute inspector but don't understand it's purpose even after searching from the internet. 我正在解决与图像长宽比有关的问题,因此只是在属性检查器中发现了对齐属性,但即使从Internet搜索后也无法理解其目的。

Any help regarding this alignment property will be highly appreciated. 有关此对齐属性的任何帮助将不胜感激。

在此处输入图片说明

It is identical to the UIImage's alignmentRectInsets property (which you would set in code by calling withAlignmentRectInsets(_:) ). 它与UIImage的alignmentRectInsets属性相同(您可以通过调用withAlignmentRectInsets(_:)在代码中进行设置)。 This is useful because a UIImageView automatically acquires its image's alignmentRectInsets (under autolayout) and so you can position/size the image view with respect to the "edges" of its visible image rather then the actual boundaries of the view. 这很有用,因为UIImageView会自动获取其图像的alignmentRectInsets (在自动布局下),因此您可以相对于其可见图像的“边缘”而不是视图的实际边界来定位/调整图像视图的大小。

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

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