单击按钮时如何更改 uiwebview 的 url?

发布于 2024-10-09 21:50:05 字数 145 浏览 0 评论 0原文

嗨,我想这很简单,希望能以简单的方式回答!

当触摸内部按钮时,如何更改 uiwebview 的 url?

意思是说我将有一个 Web 视图,每次单击按钮时,Web 视图的 URL

都会更改并重新加载新页面,

谢谢

hi i guess this is pretty simple and hope it will be answered in a easy manner!

how do i change the url of the uiwebview when a button is touched up inside?

meaning to say i will have a single web view and everytime a button is clicked the URL of the webview

changes and a new page is reloaded

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

盛装女皇 2024-10-16 21:50:05

正如您所建议的,这非常简单:

-(void)buttonPressed:(id)sender {
  [webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://website.com/"]]];
}

这一切都非常

As you suggest, it's very easy:

-(void)buttonPressed:(id)sender {
  [webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://website.com/"]]];
}

This is all very well documented.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文