2009-08-20 6 views

Répondre

2

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é.

+0

La ligne 'df.center' ne compile pas. J'ai essayé 'df.center = actionSheet.center;' mais aucune image n'est apparue. –

Questions connexes