我想將文本視圖放在特定大小的圖像視圖上,但是當我從照片庫中加載圖像時,我的文本視圖會被寫入,而我無法在其上寫入圖像。我想,當我爲bi創建一個矩形框架時,圖庫中的圖像會覆蓋文本視圖。我該怎麼辦?textview從圖庫中被圖像覆蓋
答案:這是工作OCDE:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { // set image emailImage1 = [info objectForKey:UIImagePickerControllerOriginalImage]; //bi.image = [info objectForKey:UIImagePickerControllerOriginalImage]; image = [info objectForKey:UIImagePickerControllerOriginalImage]; bi = [[UIImageView alloc ] initWithImage: image ]; bi.frame = CGRectMake(20.0f, 100.0f,260.0f, 285.0f); [self.view addSubview: bi]; [self.view bringSubviewToFront:scroll]; [[picker parentViewController] dismissModalViewControllerAnimated:YES]; [picker release]; } - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { // release picker [[picker parentViewController] dismissModalViewControllerAnimated:YES]; [picker release]; }
幫助PLZ
給出警告「uview不能響應bringubviewtofront」,它不選擇圖像窗體庫! – user720235 2011-05-23 08:24:01