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

mikezang

macrumors 6502a
Original poster
May 22, 2010
939
41
Tokyo, Japan
Apple only provide rounded-corner button, but I need some rectangle buttons, what can I do? is there any simpler way to create rectangle button? I think custom style button might be a nice choice, but I am not sure how to implement it in detail.
Please give me some hint or suggestion.
 
You can set a borderless button in IB and set the image background to a rectangle.
I want to create buttons in programming, is it possible?

By the way, do you know how to create a button looks like the buttons on standard ipad keyboard with the same color and alpha value?
 
Mike, I think if you look at the UIButton documentation you can find the api to create a custom button in code.

I don't see that those buttons have any special alpha value. Most likely is 1.0. Why do you think it's something else? With a screenshot and and Photoshop or similar app you should be able to figure out the colors. If the buttons have a gradient though you'll need to do more work.
 
Mike, I think if you look at the UIButton documentation you can find the api to create a custom button in code.

I don't see that those buttons have any special alpha value. Most likely is 1.0. Why do you think it's something else? With a screenshot and and Photoshop or similar app you should be able to figure out the colors. If the buttons have a gradient though you'll need to do more work.
Thanks, I created custom button.

Do you think if on-screen keyboard's buttons have gradient?
 
I used GIMP to pick up color of on-screen keyboard buttons and make a background image and set to my button, but they are different, why?
 

Attachments

  • SnapShot 2010-11-06 at 23.08.19.jpg
    SnapShot 2010-11-06 at 23.08.19.jpg
    152.3 KB · Views: 101
  • SnapShot 2010-11-06 at 23.15.20.jpg
    SnapShot 2010-11-06 at 23.15.20.jpg
    142.7 KB · Views: 92
Do you think if on-screen keyboard's buttons have gradient?

There is a utility on your Mac called DigitalColor Meter. It's in the Utilities folder. Finder : Go menu > Utilities item.

When you run it and move your cursor over the simulator window's buttons, it becomes clear that the normal keyboard has top-to-bottom gradients on its keys and its background.

Also, if you look at the simulator's pixels in DigitalColor Meter's magnified area, it's clear the normal keyboard buttons have a border and a shadow, while yours don't.
 
There is a utility on your Mac called DigitalColor Meter. It's in the Utilities folder. Finder : Go menu > Utilities item.

When you run it and move your cursor over the simulator window's buttons, it becomes clear that the normal keyboard has top-to-bottom gradients on its keys and its background.

Also, if you look at the simulator's pixels in DigitalColor Meter's magnified area, it's clear the normal keyboard buttons have a border and a shadow, while yours don't.
Thanks for your information, I just found it is gradient button, but I didn't know the DigitalColor Meter.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.