我對iOS編程非常陌生,並且正在製作一個簡單的應用程序。第一個UITabBarItem加載一個頁面,但在加載之前有一個標籤。我試圖讓網頁加載後標籤消失,但它不起作用。我相信我需要設置網絡視圖委託,但我不知道如何。網絡視圖完成加載labelname.hidden =是不工作?
firstcontroller.h
#import <UIKit/UIKit.h>
@interface OTFFirstViewController : UIViewController
@property (strong, nonatomic) IBOutlet UIWebView *webPage;
@property (strong, nonatomic) IBOutlet UILabel *pageLoading;
@end
firstcontroller.m
#import "FirstViewController.h"
@interface FirstViewController()
@end
@implementation FirstViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSString *fullURL = @"http://asdf.com";
NSURL *url = [NSURL URLWithString:fullURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[_webPage loadRequest:requestObj];
}
- (void)webViewDidFinishLoad:(UIWebView *)_webPage
{
_pageLoading.hidden = YES;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
爲什麼這麼多帖子開始「我是新來的......」?至少,爲我自己說話,我覺得它很煩人,而且與任何問題無關。這通常也是隱含的這種或那種方式。 – SK9
對不起,只是讓他們明白我沒有經歷過..? –
在你的筆尖中,你有沒有把webview委託連接到所有者? –