Remove Background UIVIew - Remove Rectangular Shape

I have a UIView in which I want to remove the entire background so that it looks like paper. I tried to set the background transparent from the user interface and using the code, but I always get a gray-like translucent background no matter what I do. Here is the current output I get:enter image description here

How can I remove this gray background? I need it to appear as a whole paper without this residue. Any help? I tried the following:

//     self.view.backgroundColor = [UIColor clearColor];
//
//     [self.view setOpaque:YES];
//     
   //  self.view.backgroundColor = [UIColor clearColor];.
   //  self.view.layer.borderWidth = 0.0;
    // self.view.layer.masksToBounds = YES;
  //   self.view.backgroundColor=[[UIColor clearColor] colorWithAlphaComponent:.0];

And the current user interface configuration:
enter image description here

How can I remove it ?? Any help !?

EDIT 1 This is a new outlet. enter image description here

+4
source share
1 answer

, . , :

self.view.superview.backgroundColor [UIColor clearColor]; viewWillLayoutSubviews

- (void)viewWillLayoutSubviews
{

    [super viewWillLayoutSubviews];
     self.view.superview.layer.masksToBounds = YES;
     self.view.superview.backgroundColor = [UIColor clearColor];
}
+1

Source: https://habr.com/ru/post/1585060/


All Articles