【发布时间】:2011-02-18 06:16:19
【问题描述】:
我想在 webview 中显示图像,但我的问题是我想在不同尺寸的 ipad 和 iphone 中显示相同的图像。 目前在我的项目中,我正在从数据库中获取图像,我正在获取 url。我应该如何与 iphone 和 ipad 有所不同。请帮助 我现在在 css 中使用了这段代码,我在运行时编写了尺寸和附加标签,但它没有替换字符串,为什么它没有替换我不知道的字符串。如果有人知道,请在任何情况下帮助我。
if ([deviceType isEqualToString:@"iPad Simulator"])
{
//contentString =[contentString stringByReplacingOccurrencesOfString:@"/>" withString:@"width:\"30%\" height:\"30%\"/>"];
contentString =[contentString stringByReplacingOccurrencesOfString:@"/>" withString:@"class=\"img_ipad\"/>"];
}
else
{
contentString =[contentString stringByReplacingOccurrencesOfString:@"/>" withString:@"width:\"70%\" height:\"70%\"/>"];
}
【问题讨论】:
标签: iphone ipad uiwebview ios-simulator