[MonoTouch] Question regarding setting background image for UIButton.

Leonardo Suryana leonardo at torqsoftware.com
Fri Oct 23 00:04:06 EDT 2009


Hi Geoff,

 

THANKS! That was it. Can't believe I missed that. Much appreciated.

 

 

Leonardo Suryana 

Software Engineer 

 <http://www.torqsoftware.com/> Torq Software

"Your business success through software development"

 

t: +61 8 6555 6507 e:  <mailto:leonardo at torqsoftware.com>
leonardo at torqsoftware.com 

f: +61 8 9409 5907 w:  <http://www.torqsoftware.com> www.torqsoftware.com

a: Unit 1A 30 Buckingham Drive, Wangara, Western Australia 6065

 

From: Geoff Norton [mailto:gnorton at novell.com] 
Sent: Friday, 23 October 2009 11:59 AM
To: Leonardo Suryana
Cc: monotouch at lists.ximian.com
Subject: Re: [MonoTouch] Question regarding setting background image for
UIButton.

 

Leonardo,

 

  I've cc'd the list in my resolution for this issue having looked at your
test case so that everyone and the archives are aware of the issue..  What
you have here is an oddity.  Mac OSX has a case-aware but insensitive file
system, but the iPhone is case-sensitive and aware.  In your project you had
a imagename.jpg which you referred to in code as Imagename.jpg.  This
succeeded on the simulator as its not case-sensitive, but failed on the
device as it is.

 

Geoff Norton

 

On 22-Oct-09, at 11:19 PM, Leonardo Suryana wrote:





Hi Geoff,

 

Thanks for the reply,

 

It seems to not be able to find the image and throwing a NullException. The
image is saved in the project and the build action is content. Is this
correct?

 

 

Leonardo Suryana

Software Engineer

 <http://www.torqsoftware.com/> Torq Software

"Your business success through software development"

 

t: +61 8 6555 6507 e:  <mailto:leonardo at torqsoftware.com>
leonardo at torqsoftware.com

f: +61 8 9409 5907 w:  <http://www.torqsoftware.com> www.torqsoftware.com

a: Unit 1A 30 Buckingham Drive, Wangara, Western Australia 6065

 

From: Geoff Norton [mailto:gnorton at novell.com] 
Sent: Friday, 23 October 2009 11:15 AM
To: Leonardo Suryana
Cc: monotouch at lists.ximian.com
Subject: Re: [MonoTouch] Question regarding setting background image for
UIButton.

 

Leonardo,

 

  Have you looked at the Xcode Organizer->Console to see what the error is
on device?

 

Geoff

 

On 22-Oct-09, at 10:38 PM, Leonardo Suryana wrote:






Hey,

 

I've been using a few buttons on my test app and would love for those
buttons to have a background image associated with them.

Now in my Main.cs under the FinishedLauching method, I've set the background
image for one of my buttons (let's call it button A) to an image:

 

buttonA.BackgroundColor = UIColor.Clear;

buttonA.SetBackgroundImage(UIImage.FromFile("random.png"),
UIControlState.Normal);

 

and this works beautifully when deployed in the simulator. Now when I
deployed it on my iPod Touch, however, the app seems to not be able to load.

Has anyone have this issue before or did I do something wrong?

 

Specs:

MonoTouch 1.1.1 Professional Edition

Mono Develop 2.2 Beta 1

Mac OS 10.5

iPhone SDK 3.1.2

 

THANKS!

 

Leonardo Suryana

Software Engineer

 <http://www.torqsoftware.com/> Torq Software

"Your business success through software development"

 

t: +61 8 6555 6507 e:  <mailto:leonardo at torqsoftware.com>
leonardo at torqsoftware.com

f: +61 8 9409 5907 w:  <http://www.torqsoftware.com> www.torqsoftware.com

a: Unit 1A 30 Buckingham Drive, Wangara, Western Australia 6065

 

_______________________________________________
MonoTouch mailing list
MonoTouch at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monotouch/attachments/20091023/29593b2e/attachment-0001.html 


More information about the MonoTouch mailing list