iOS add / remove shadow from a view

后端 未结 6 2213
遇见更好的自我
遇见更好的自我 2021-02-12 22:14

I do not understand how to remove a shadow that was added to a view. I add to my view in initWithFrame a shadow in this way:

self.layer.borderWidth          


        
6条回答
  •  难免孤独
    2021-02-12 23:03

    Sorry, not sure the correct way, but have you tried changing the properties of the layer shadow? For example, one of these;

     layer.shadowOffset = CGSizeMake(0, 0);
     layer.shadowColor = [[UIColor clearColor] CGColor];
     layer.cornerRadius = 0.0f;
     layer.shadowRadius = 0.0f;
     layer.shadowOpacity = 0.00f;
    

提交回复
热议问题