vermin
vermin

Reputation: 1099

How to create an embossed button in objective c programmatically?

How can I create a styled button like the one showed below? I know Facebook is using the Three20 framework to generate the buttons programmatically. I think it's overwhelming.

I'm rather new developer of ios so I wonder what is the most common way to create buttons like this? (except for using images).

Facebook iPhone App

Upvotes: 3

Views: 3309

Answers (3)

Vineet Bhatia
Vineet Bhatia

Reputation: 2533

  1. You can use Jess Martin's CoolButton that draws glassy iOS style buttons, all using CoreGraphics and no images - https://github.com/jessmartin/CoolButtons
  2. Jeff Lamarche's iPhone Gradient buttons - http://code.google.com/p/iphonegradientbuttons/

Look at related questions on StackOverflow.

Upvotes: 2

AAV
AAV

Reputation: 3803

Simple way to create is

  1. Create UIButton programmatically
  2. Use gradient to create that background effect.

To create gradient for back ground use: CAGradientLayer, CAGradientLayer.frame and CAGradientLayer.color

Assign gradient to the button use: AddSublayer, CornerRadius, and MasksToBounds on UIButton.

Upvotes: 3

user843337
user843337

Reputation:

When I want a button like that I tend to just create it in software such as Photoshop. Then you can just set a UIButton to have a custom style and setup the image as the button background.

Here is a nice tutorial on creating button in photoshop. Hope this helps.

Upvotes: 0

Related Questions