就图像而言,值UIViewAutoresizingNone
对应于哪个图像对应于何时在视图上设置?
答案 0 :(得分:1)
您说得对,您所显示的图片相当于UIViewAutoresizingNone
。
自动调整,您可以从 Interface Builder 中看到,
以编程方式 这些struts表现为上面图像的“颠倒”,
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight
)相当于
UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin |UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin
)相当于
UIViewAutoresizingNone
相当于
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin
)相当于
UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin
)相当于
UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight
)相当于
UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight
)相当于
UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleWidth
)相当于
UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin
)
答案 1 :(得分:0)
为UIViewAutoresizingNone
执行此操作:
对于将来的参考,请使用侧面示例,其中显示了自动调整大小的行为:
答案 2 :(得分:0)
是的,您问题中的图片表示UIViewAutoresizingNone
。设置外侧的栏表示“非弹性”,但内侧的箭头表示flexible
。
请注意,如果您尝试设置UIViewAutoresizingNone
,然后调整超级视图的大小,则不会因为某些内容需要更改而受到尊重。