【问题标题】:WebSite in application and Refresh button应用程序中的网站和刷新按钮
【发布时间】:2012-12-03 18:49:49
【问题描述】:

如何在应用程序的标签上显示网站?

并创建刷新按钮

【问题讨论】:

  • 你的问题不清楚。请考虑对其进行编辑,指定您想要实现的目标。
  • 我想在我的应用程序中显示网站,例如:有名称为 google 的标签,当我点击它时,标签显示给我 google

标签: iphone ios web refresh


【解决方案1】:

假设您想将 UIWebView 添加到 UIViewController。把它放在你的 viewDidLoad 方法中:

UIWebView *wv = [[UIWebView alloc] initWithFrame:self.view.frame];
NSURLRequest *req = [[NSURLRequest alloc] initWithURL:[NSURL urlWithString:@"www.google.com"]];
[wv loadRequest:req];
[self.view addSubview:wv];

关于刷新按钮:确保在您的 .h 文件中定义了“wv”并使用此方法:

- (IBAction)refresh
{
    [wv reload];
}

【讨论】:

    猜你喜欢
    • 2013-02-21
    • 1970-01-01
    • 2017-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多