如何将UIButton放置在另一个UIImageView上,这是一个圆形轮廓图像?

问题描述:

我的应用程序中有一个配置文件设置页面,因此我需要在配置文件图像上放置另一个UIButton以从相机或照片库中选择图像。所以我很困惑如何在故事板中放置约束条件。如何将UIButton放置在另一个UIImageView上,这是一个圆形轮廓图像?

配置文件图像随屏幕尺寸增大,但我想UIButton放置在底部以增加尺寸。

UIImageView的约束足见其个人资料照片:

UIImageView constraints . It grows along with Size

UIButton包含图像为:

UIButton Image

现在我想将这个按钮,上面显示的图像到配置文件图像视图。

它需要的约束是什么,以便它恰好在配置文件图像视图的底部并随着大小而增长。

The selected UI component is a Button . I need to set the constraints for this

只要改变约束的Y位置是button.bottom = profileImage.bottom - 10还是要放在那里不管不变。这样,按钮将始终停留在图像的底部,根据您的约束,调整大小将由Autolayout正确处理。