开发者

UIView mysteriously expand by 1 pix when added to as subview

开发者 https://www.devze.com 2023-01-15 17:49 出处:网络
I created a开发者_StackOverflow社区 custom \"component\" made up of UIView and it gets added as subview on any visible view. What I found strange is that when it get added to a view the second time, t

I created a开发者_StackOverflow社区 custom "component" made up of UIView and it gets added as subview on any visible view. What I found strange is that when it get added to a view the second time, the width got increased by 1 pix. This caused a problem when it expanded the background image and causes the image to blur out.

Any ideas why a view will get expanded (or shrink) when added to another view?


The issue may be related to the location of the view. Perhaps one of these stories will shed more light on the issue:

Fixing Blurry Subviews

Why does a PNG image sometimes get blurry depending on its position in a view

0

精彩评论

暂无评论...
验证码 换一张
取 消