Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make a UIView glossy and shiny?

I'm coding an iPhone app annd I currently have a View that looks like this:

alt text http://drop.io/download/public/hzkqdxyhlev1qul5hx3z/b7fbcecca653fb1a4961f2aecca5ba76c614ad0b/4009e6e0-fa41-012c-64cb-f7b7db223b21/410e4f50-fa41-012c-a999-f4d9d7fd044b/v2/thumbnail_large

I'm wondering if there is a way to make it shiny and glossy like the Phone.app call screen.

Thanks!

like image 630
Anthony Glyadchenko Avatar asked Dec 07 '22 04:12

Anthony Glyadchenko


1 Answers

If you're looking to draw glossy gradients on UIViews, I provide some code in this answer to do that.

Going beyond that, I have published the source code for a sample application which shows how to draw even more polished glossy buttons and how to replicate the glossy highlights that Apple uses in some of the built-in user interface elements (in this case, I replicate UIAlertView's style).

This application was written for the class I teach on advanced iPhone development, for which the course notes are available here in VoodooPad format. The section on Quartz 2D explains how this drawing code works.

like image 186
Brad Larson Avatar answered Dec 29 '22 00:12

Brad Larson