Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试创建个人资料图像选择按钮。但是,每次我使用 UIImagePickerController 选择图像时,图像都会溢出按钮边框的底部。有没有办法确保图像保持在边界内
将按钮剪辑设置为边界 true
button.clipsToBounds = true
从属性部分选择 clipToBounds,或添加button.clipsToBounds = true. 尝试使用Autofit。它也可以在attribute情节提要的部分中找到。
Autofit
attribute