Gradient background not working if we replace an UIView instead of UIImageView in HeaderExample of Parchment

94 views Asked by At

I am using parchment library for pagination in my application. When I replace the UIImageView with a UIView in the header example of Parchment, gradient background is not working. I only see white screen.

Gradient works if I add separately in a view, with Parchment, I believe it is overlapped by some layer. I also tried this link but did not work. https://github.com/rechsteiner/Parchment/issues/181

Actual result is a white screen in the header view, expected is the gradient fill.

1

There are 1 answers

0
Scott R. On

The UIImageView.... if the gradient is being displayed as a bitmap in the .image of the UIImageView, that would explain the gradient disappearing.

UIView’s do not have a .image - That is why UIImageViews are needed to display bitmaps.