iOS White to Transparent Gradient Layer is Gray

前端 未结 7 1211
清歌不尽
清歌不尽 2021-02-01 11:53

I have a CAGradientLayer inserted to the bottom of this small detail view that pops up at the bottom of the app. As you can see, I\'ve set the colors from white to clear, but th

7条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-01 12:27

    clearColor has a black color channel with an alpha of 0, so I had to use

    [UIColor colorWithWhite:1 alpha:0]
    

    and it works fine.

提交回复
热议问题