【发布时间】:2023-03-22 00:49:01
【问题描述】:
目前我正在使用 iPhone 应用程序,使用 UIWebview 加载地址,如“美国”,然后运行应用程序,屏幕上未显示地图。我想从用户输入搜索栏字段中显示位置,如何解决这个 iuissue?请帮帮我
提前致谢
我试过了:
webView=[[UIWebView alloc]initWithFrame:CGRectMake(0, 40, 320,376)];
webView.delegate=self;
webView.scalesPageToFit=YES;
NSString *mapurl = @"http://maps.google.com/maps?q=";
NSString *urlString1 = [mapurl stringByAppendingFormat:@"America"];
NSString *OmitSpace = [urlString1 stringByReplacingOccurrencesOfString:@" " withString:@"%20"];
NSURL *url=[NSURL URLWithString:OmitSpace];
NSURLRequest *requestObj=[NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
屏幕截图:
【问题讨论】:
标签: iphone ios webview maps location