• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cahnging bgColor of a UIView not working.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cahnging bgColor of a UIView not working.


  • Subject: Re: Cahnging bgColor of a UIView not working.
  • From: Brandon Walkin <email@hidden>
  • Date: Wed, 29 Jul 2009 07:52:37 -0400

The arguments to that UIColor method should be in the range of 0 to 1. Divide each RGB value by 255 to get them into that range.


On 2009-07-29, at 6:34 AM, Gustavo Pizano wrote:

Hello, well I found the reason of the exception. But still they color its not being changed.... if I put [UIColor blueColor] then it works, but it doesn't work with RGB doing [[UIColor alloc] initWithRed ...... ]
I tried also [UIColor colorWithCGColor:CGColorCreateGenericRBG (....)]; but the compiler just decided to send error that the method CGColorCreateGenericRGB its unreachable, even I have the CoreGraphics library in the project and im importing in in the file... dunno what to do.. I need to be very accurate with the color that im setting, I know the values in rgb but why is not working?



Thnaks Gustavo Pizano



On Jul 29, 2009, at 11:29 AM, Gustavo Pizano wrote:

Hello.

Im trying to change the color of a UIView programatically but something is wrong.


Im pressing a button which triggers an IBAction, which does the following:


[[self view] setBackgroundColor:[UIColor colorWithRed:20.0 green: 10.0 blue: 30.0 alpha:1.0]];

but when I press the button the program blows with an NSInvalidArgumentException..

what am I doing wrong?


thanks

Gustavo Pizano




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Cahnging bgColor of a UIView not working.
      • From: David Duncan <email@hidden>
    • Re: Cahnging bgColor of a UIView not working.
      • From: Gustavo Pizano <email@hidden>
References: 
 >Cahnging bgColor of a UIView not working. (From: Gustavo Pizano <email@hidden>)
 >Re: Cahnging bgColor of a UIView not working. (From: Gustavo Pizano <email@hidden>)

  • Prev by Date: Re: Cahnging bgColor of a UIView not working.
  • Next by Date: Re: Cahnging bgColor of a UIView not working.
  • Previous by thread: Re: Cahnging bgColor of a UIView not working.
  • Next by thread: Re: Cahnging bgColor of a UIView not working.
  • Index(es):
    • Date
    • Thread