How to make custom buttons in iOS?

后端 未结 7 1510
野的像风
野的像风 2021-02-06 09:01

The default iOS UI is nice but if I wanted to use images for buttons instead how would I do that - is it OpenGL?

7条回答
  •  庸人自扰
    2021-02-06 10:05

    You can do it by setting image or backgroundImage properties of a UIButton. If you want your button to look nice when the size changes, you can use stretchableImageWithLeftCapWidth:topCapHeight: method of UIImage, with an appropriate image.

    You may also want to use a custom component if it satisfies your need.

提交回复
热议问题