开发者

Question on iPhone Development Custom UI

开发者_如何学编程So on the App Store, what I'm seeing a lot is a custom UI that still looks like the native Apple ones, but is some how "spruced up" in look. How exactly would I create something like that, as in say a button that is a hexagon or something instead of a rounded rectangle?

Thanks,

VectorWare


  • Draw any image you want, using your favorite art program.
  • Don't forget to make pressed and "up" states.
  • Create your button (in IB or code.)
  • Make the button of type UIButtonTypeCustom (IB or code.)
  • In IB, set the button's image to your image.
  • Set the image separately for NORMAL and HIGHLIGHTED states (IB or code.)

Example in code:

[myButton setImage: myImage forState: UIControlStateNormal];


They are probably either subclass' of UIView/UIWhatever or images with a transparent UIButton over top of the image. Is there something specific you want to implement?

Some examples: Subclassing a UIView

UIView subclass dialog window

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜