ios - How do I assign a textcolor to a label from an array of colors? -


I'm trying to create one of the UILabel five colors

< Pre> - (zero) viewDidoadload [[Super Viewedload]; NSString * Random Collar = [ColorRayezObjectOntIndex: ARC4Random ()% [Color Count]]; Color = [[NSARLALO] Init]; [UIColor redColor], [UIColor bluecolor], [UIColor greenColor], [UIColor yellowColor]; ColorLabel.textColor = Random Color; }

How do I set an orange for the text of the label as UIColor ? Sorry, if it has already been answered, then I can not understand it correctly to understand it correctly.

try it ...

  define #Concolor4 - (UIColor *) Random Caller {NSInteger colorIndex = arc4random ()% kNumColors; UIColor * color; Switch (Color Index) {Case 0: Color = [UIColor blueColor]; break; Case 1: Color = [UIColor redColor]; break; Case 2: Color = [UIColor yellowColor]; break; Case 3: Color = [UIColor greenColor]; break; } The color of the return; }  

To assign a random color ...

  colorLabel.textcolor = [auto random color];  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -