Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xStep

macrumors 68020
Original poster
Jan 28, 2003
2,031
143
Less lost in L.A.
Friday I spent time figuring out how to customize UIAlertView to allow altering the message text color and altering the background color of that text body. It was an interesting exercise to say the least. As a side note, when the messages gets large, Apple changes the UILabel to some type of internal custom UIWebView to allow scrolling.

Such a hack wouldn't be allowed in the App store I'm sure, but this is an enterprise distributed app that doesn't have to go through that process. I'm wondering how popular this tactic is in enterprise development. Can those with such exposure please comment.

Thank you for your insight.

P.S. For those wondering, yes, I placed in defensive coding in case Apple alters something that would break the subclass. I coded (and tested) it to gracefully downgrade to the normal UIAlertView expectations. I wish I was allowed to share the code as I think I did nice work on this. :)
 
To be honest, instead of trying to altert basic Apple Elements, we just entirely create our own for a project.. And it's mostly a nice starter for another project. So for example for the UIAlertView we create our own, with our own enum's etc. This is then also allowed on the APple store :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.