uiview上的圆角半径未按预期工作 [英] corner radius on a uiview not working as expected

查看:75
本文介绍了uiview上的圆角半径未按预期工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

cornerRadius = (view.frame.size.height / 2.0)

似乎没有按预期工作.怎么解决呢?可能是什么问题?

Doesn't seem to work as expected. How to solve this? What might be the issue?

输出屏幕-

推荐答案

在这种情况下,我的解决方案是将prepareUI方法放入viewDidLayoutSubviews中.尝试在下面添加代码.

My solution in this case is you should put prepareUI method in viewDidLayoutSubviews. Try to add the code below.

override func viewDidLayoutSubviews() {
    self.prepareUI();
}

这篇关于uiview上的圆角半径未按预期工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆