我有一个UIWebView,希望在链接加载完成后使其可见。它一开始是隐藏的,直到需要显示时才起作用。我确定可以使UIWebView再次可见,因为我在调用URL之后放置了它。但是,当UIWebView确实加载完成时,我确定
.m文件:
webViewDidFinishLoading
方法没有被调用,也不会记录该方法中的内容。可能是什么原因导致这个问题?谢谢。下面是我的代码:.m文件:
@interface KnoxGradesViewController : UIViewController <UIWebViewDelegate> {
IBOutlet UIWebView *webView;
IBOutlet UIButton *log;
IBOutlet UISwitch *rem;
IBOutlet UIActivityIndicatorView *stat;
}
@property (nonatomic, retain) IBOutlet UIButton *about;
@property (nonatomic, retain) IBOutlet UITextField *username;
@property (nonatomic, retain) IBOutlet UITextField *password;
@property (nonatomic, retain) IBOutlet UIButton *login;
@property (nonatomic, retain) IBOutlet UILabel *warning;
@property (nonatomic, retain) IBOutlet UIWebView *webView;
@property (nonatomic, retain) IBOutlet UIButton *log;
-(IBAction)showAbout;
-(IBAction)checkFields;
-(IBAction)logOut;
头文件.h:
- (void)webViewDidFinishLoad:(UIWebView *)mwebView {
NSLog(@"Got here!");
[mwebView setHidden:false];
}