且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将图像添加到UIActionSheet

更新时间:2023-12-06 16:41:28

尝试一下:

(void)willPresentActionSheet:(UIActionSheet *)actionSheet{

UIImageView* df = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yourpic.png"]];
df.center

[actionSheet addSubview:df];
//scale image aspect to fit image view
df.contentMode = UIViewContentModeScaleAspectFit;
//change width of frame
CGRect frame = df.frame;
frame.size.width = 50;
df.frame = frame;

} 

它将如图所示调整其大小.

It will resize it as shown.