1
我有一些簡單的代碼,它從文檔目錄中提取圖像並將其加載到imageView中。模擬器中的反轉圖像
- (void)viewDidLoad
{
[super viewDidLoad];
NSString* pathToFile = [NSString stringWithFormat:@"%@/images/%@",[self documentsDirectory],@"copy.jpg"];
UIImageView *tmp = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:pathToFile]];
[self.view addSubview:tmp];
}
- (NSString *)documentsDirectory
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
return [paths objectAtIndex:0];
}
我的圖片在查看時顯示正確,但是當它被加載到應用程序中並在模擬器上查看時,它是倒置的。
實施例:https://skitch.com/critz/fnh8p/colorsnapper
任何意見,建議..將是/大大/理解..
不確定。你試過其他圖片嗎? – Chanok 2011-06-03 19:42:41