색상 그라디언트로 프로그래밍 방식으로 UIView 만들기 런타임에 그라디언트 색상 배경 (단색에서 투명으로)으로 뷰를 생성하려고합니다. 그렇게하는 방법이 있습니까? 목표 -C : UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 50)]; CAGradientLayer *gradient = [CAGradientLayer layer]; gradient.frame = view.bounds; gradient.colors = @[(id)[UIColor whiteColor].CGColor, (id)[UIColor blackColor].CGColor]; [view.layer insertSublayer:gradient atIndex:0]; 빠른:..