观点层次结构:
答案 0 :(得分:0)
你的约束应该是:
ImageView:horizontally in container, Vertically in container, fixed width, fixed height
按钮:horizontally in container(align center x) and top
。如果需要那么fixed height and width
(这只需要按钮不是默认值意味着自定义按钮其他明智的两个约束就足够了 - 容器和顶部水平)
然后在你的viewDidload中设置你的imageview的cornerradius,
self.imageViewProfile.layer.cornerRadius = 26.5; //corner radius should be exact half of your imageView's height
self.imageViewProfile.layer.masksToBounds = YES;
希望这会有所帮助:)