1
Comment ajouter une image dans UIActionSheet?Ajouter une image dans UIActionSheet
Comment ajouter une image dans UIActionSheet?Ajouter une image dans UIActionSheet
Essayez ceci:
(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;
}
Il redimensionnera comme indiqué.
La ligne 'df.center' ne compile pas. J'ai essayé 'df.center = actionSheet.center;' mais aucune image n'est apparue. –