English 中文(简体)
• 如何在讲解语的台上播种图像
原标题:how to crop a image circle in iphone sdk

I m 试图利用Piber上摄像机的图像,为UIButton的习俗造影。 纽顿有循环背景,实际上是一个循环。 现在,我需要一个形象,在也出现在四舍五入的 but子中间。

谁能帮助我?

事先感谢

问题回答

You must have set the corner radius of the button s layer to make it circular. But you cant do same with an image accurately.

You need to set the image property of the UIButton for the states you want. But more importantly make sure the image is also round.

图像不能四舍五入。 如果你使用一个PNG,它就会支持透明度,从而具有透明度,从而显示这种形象。

btnImage = [UIImage imageNamed:@"image.png"];
[circularBtn setImage:btnImage forState:UIControlStateNormal];




相关问题
Help with Open GL iPhone

I am trying to put an OpenGL View into my application but I want to make sure that before I do this that the view is transparent because I want to see and interact with the view behind it as well as ...

Image loads in simulator but not device?

In Interface Builder, I have a UIImageView in a nib and have selected an image from the View Attributes pane. The image loads fine in the simulator but not on my device in debug mode. I don t get ...

pixel value in UIImageView s image

I m trying to find the value of an pixel in the image displayed in an UIImageView. getting the pixel on the display is (relatively) simple. But when the image displayed is scaled (say the orgig. image ...

changing image dynamically in iPhone application

My problem is, I have table of names. And when I touch on each name, a new view should appear and image of corresponding name. For all the names only one view should be there and the image should ...

UIImageView - How to get the file name of the image assigned?

Is it possible to read the name of an UIImageView s UIImage that s presently stored in the UIImageView? I was hoping you could do something kind of like this, but haven t figured it out. NSString *...

UIImageView drifting on viewDidLoad

I am programmatically adding a UIImageView and a UILabel to multiple screens in a program I m working on. As such, I ve written a UIViewController that contains the code to load up the UIImageView ...

热门标签