swift - Frame width is not the full screen width -


i'm adding gradient view , it's cutting off width on 1 side.

my code adding gradient is

let gradientlayer = cagradientlayer() gradientlayer.frame = fadeview.frame gradientlayer.colors = [uicolor.maincolor().cgcolor, uicolor.white.cgcolor]  fadeview.layer.addsublayer(gradientlayer) 

the fadeview inside of vertical stackview, inside of view inside of scrollview, of have horizontal constraints on left , right of 0, not constraining margins.

the frame width fadeview (and other views other main view) 320, might because of device i'm testing on. width of screen 375.

what's causing cut off this?

change

 gradientlayer.frame = fadeview.frame 

to

gradientlayer.frame = fadeview.bounds 

Comments

Popular posts from this blog

python 2.7 - Given three nested dictionaries, sort the top two nested dictionaries from a value in the innermost dictionary? -

angular - DownloadURL return null in below code -