Zanik dno UIScrollView do przezroczystości

Mam UIScrollView i potrzebuję dna, aby zanikało do przezroczystości, tak aby nie odcięło nagle zawartości. Tło UIScrollView jest kolorem niestandardowym. To jest to, co mam do tej pory, ale warstwa jest biała, zamiast koloru niestandardowego. Właśnie to zamierzam, ale tylko na dole.

:

Oto, co mam do tej pory:

maskLayer = [CAGradientLayer layer];

            CGColorRef firstColor = [UIColor colorWithRed:141 green:211 blue:244 alpha:1.0].CGColor;
            CGColorRef secondColor = [UIColor colorWithRed:141 green:211 blue:244 alpha:0.8].CGColor;
            CGColorRef thirdColor = [UIColor colorWithRed:141 green:211 blue:244 alpha:0.2].CGColor;
            CGColorRef fourthColor = [UIColor colorWithRed:141 green:211 blue:244 alpha:0.0].CGColor;

            maskLayer.colors = [NSArray arrayWithObjects:(__bridge id)firstColor, (__bridge id)secondColor, (__bridge id)thirdColor, (__bridge id)fourthColor, nil];
            maskLayer.locations = [NSArray arrayWithObjects:[NSNumber numberWithFloat:0.0],
                                                        [NSNumber numberWithFloat:0.2],
                                                        [NSNumber numberWithFloat:0.8],
                                                        [NSNumber numberWithFloat:1.0], nil];
            maskLayer.frame = CGRectMake(0, 285, self.loginScrollView.frame.size.width, 40);
            maskLayer.anchorPoint = CGPointZero;
            [self.loginScrollView.layer addSublayer:maskLayer];

Z jakiegoś powodu warstwa jest wyświetlana jako biała i ma tylko połowę szerokości przewijania.

questionAnswers(4)

yourAnswerToTheQuestion