iOS: frame.size.width/2 doesn't produce a circle on every device

后端 未结 6 1429
长发绾君心
长发绾君心 2020-11-29 06:09

I\'m aware that the formulae frame.size.width/2 should produce a circle border, however in XCode I am currently experiencing some discrepancies.

I have

6条回答
  •  心在旅途
    2020-11-29 06:41

    The formula you used will only work for squared image. Are you using auto lay out? Maybe it could be stretched for the device that you used. If this is the case, then height will be higher than width,or vice versa. That is, the image will be some kind of rectangle, and it will not produce perfect circle.

提交回复
热议问题