如何将图像添加到UIActionSheet中?
答案 0 :(得分:2)
试试这个:
(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;
}
如图所示,它会调整大小。