カスタムUITableViewCellにあるUILabelのテキストの後ろにグラデーションレイヤーを追加しようとしています。問題は、グラデーションがラベルのテキストを隠していることです。すでにこのリンクにアクセスしましたが、機能していません。テキストレイヤーの後ろに追加するにはどうすればよいですか?
私がこれまでに行ったことは次のとおりです。
CAGradientLayer *gradient = [CAGradientLayer layer];
gradient.frame = CGRectMake(0, 0, buyPrice_port.frame.size.width, buyPrice_port.frame.size.height);
gradient.colors = [NSArray arrayWithObjects:(id)gainBackgroundColor1, (id)gainBackgroundColor2, nil];
gradient.locations = [NSArray arrayWithObjects: [NSNumber numberWithFloat:0.00], [NSNumber numberWithFloat:0.70] , nil];
[buyPrice_port.layer insertSublayer:gradient atIndex:0];
buyPrice_port.textColor = [UIColor blackColor];