如何在iPhone中使用图像背景制作按钮? [英] how to make button round with image background in IPhone?
本文介绍了如何在iPhone中使用图像背景制作按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个圆形按钮,但我会让它有一个带图像的背景。
I have a round button, but i will make it have a backgroud with image.
但是当我这样做时,通过将(what)属性设置为图像,按钮变为矩形,因为图像是矩形。如何保持按钮轮?
but when i do it, by setting the (what) property to an image, the button becomes rectangle because the image is a rectangle. How do I keep the button round?
推荐答案
只需这样做
#import <QuartzCore/QuartzCore.h>
myButton.layer.cornerRadius = 8;
这篇关于如何在iPhone中使用图像背景制作按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文