1. Create a single view class
2. Create 3 controls on the View controller text View,button, WebView
3. The text view, WebView Wind, is named Url,web
//
// ViewController.h
// webview1
//
// Created by HeJiasheng on 13-11-12.
// Copyright (c) 2013年 HeJiasheng. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@property (Strong,nonatomic) Iboutlet Uitextfield *URL;
@property (Strong,nonatomic) Iboutlet UIWebView *Web;
@end
4. To create a button's Click event as Bclick
@implementation viewcontroller
- ( Span class= "Typ" style= "Color:teal" >ibaction Span class= "PLN" style= "Color:rgb (72,72,76)" >bclick :( id ) sender {
Nsurl * url1 =[ nsurl urlwithstring : self url text ];
Nsurlrequest * request =[ nsurlrequest Requestwithurl : url1 ];
[ self web loadrequest : request ];
}
So you can use it, enter the URL in text, pay attention to HTTP//
Http://www.jeapedu.com