top を持つ webview を持つアプリを構築しようとしていUIToolBar
ます。このアプリは社内で使用するためのもので、私はこれを構築する任務を負いました。この特定の Web ビューは、ユーザーが内部 Web サイトから読み込まれた FAQ を読みたい場合に表示されます。この Web ビューはモーダルとして読み込まれ、閉じるにはボタンが必要UIToolBar
です。しかし、私は運がありません。
現在の実装では、 http://www.google.comをUIToolBar
. 私は何を間違っていますか?
LoginWebviewController.h
#import <UIKit/UIKit.h>
@interface LoginWebViewController : UIViewController
@end
LoginWebviewController.m
#import "LoginWebViewController.h"
@interface LoginWebViewController ()
@end
@implementation LoginWebViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"Log in";
// Do any additional setup after loading the view.
[self.navigationController setNavigationBarHidden:NO animated:YES];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(barButtonBackPressed:)];
UIWebView *webview=[[UIWebView alloc]initWithFrame:CGRectMake(0, 0, 1024,768)];
NSString *url=@"http://www.google.com";
NSURL *nsurl=[NSURL URLWithString:url];
NSURLRequest *nsrequest=[NSURLRequest requestWithURL:nsurl];
[webview loadRequest:nsrequest];
[self.view addSubview:webview];
}
-(void)barButtonBackPressed:(id)sender{
[self dismissModalViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end