Invalid context when creating UIImageView

前端 未结 4 1557
甜味超标
甜味超标 2021-02-05 23:06

I have an error when I tried to create a UIImageView. Look at this code :

UIImage* backgroundPanel = [[UIImage imageNamed:@\"loginPanelBackground.png\"] resizabl         


        
4条回答
  •  离开以前
    2021-02-05 23:40

    I had this problem until I found out that my cap inset argument to resizableImageWithCapInsets: was wrong — it didn't leave any un-capped area at all (you need at least 1x1 pixel not covered by a cap). So make sure that:

    (insets.left + insets.right) < width

    and

    (insets.top + insets.bottom) < height

提交回复
热议问题