這裏是我使用的代碼:關於在UIWebview中嵌入UIImage的問題;你如何擺脫邊界?
NSString *imagePath = [[NSBundle mainBundle] resourcePath];
imagePath = [imagePath stringByReplacingOccurrencesOfString:@"/" withString:@"//"];
imagePath = [imagePath stringByReplacingOccurrencesOfString:@" " withString:@"%20"];
NSString *HTMLData = @"<meta name=\"viewport\" content=\"width=320\"/> <img src=\"image.png\" alt=\"\" width=\"320\" height=\"480\">";
[self.webView loadHTMLString:HTMLData baseURL:[NSURL URLWithString: [NSString stringWithFormat:@"file:/%@//",imagePath]]];
[self.webView setScalesPageToFit:YES];
有周圍的Web視圖圖像白色邊框。有沒有什麼辦法讓圖像佔據屏幕?
編輯:新增截圖
在此先感謝您的幫助。
可以發表它的截圖嗎? – booleanBoy