iOS 本地加载html登陆页面
2016-09-15 17:09
357 查看
Html的代码
CSS的代码
iOS 的代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>登陆页面</title> <link href="CSS/Login.css" rel="stylesheet"> </head> <body> <!--最外层--> <div id="content"> <!--面板--> <div class="panel"> <!--账号--> <div class="group"> <label>账号</label> <input placeholder="请输入账号"> </div> <!--密码--> <div class="group"> <label>密码</label> <input placeholder="请输入密码" type="password"> </div> <!--登陆--> <div class="login"> <button>登陆</button> </div> </div> <!--注册--> <div class="reg"> <button>创建新账号?</button> </div> </div> </body> </html>
CSS的代码
body{ background-color: #f2f2f2; } #content{ margin-top: 100px; /*background: red;*/ text-align: center; } #content .panel{ display: inline-block; background-color: white; border: 1px solid #ddd; border-radius: 5px; padding: 20px; } #content .panel .group{ } /*s输入框*/ #content .panel .group input{ display: block; width: 250px; height: 33px; padding-left: 7px; font-size: 15px; border: 2px solid #ddd; } /*伪类*/ #content .panel .group input:focus { outline: none; border-color: #CC865E; } #content .panel .group label{ display: block; text-align: left; height: 30px; line-height: 30px; font-size: 20px; } #content .login{ margin-top: 20px; } /*登陆*/ #content .login button{ width: 250px; background-color: #CC865E; } #content .login button:hover{ background-color: white; color: #CC865E; border: 1px solid #CC865E; cursor: pointer; } #content button{ height: 33px; border: 0px; color: white; font-size: 18px; border-radius: 3px; } #content .reg{ margin-top: 20px; } /*注册*/ #content .reg button{ width: 250px; background-color: #466BAF; } #content .reg button:hover { background-color:white; color: #466BAF; border: 1px solid #466BAF; cursor: pointer; }
iOS 的代码
#import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
#import "AppDelegate.h" #import "RootViewController.h" @interface AppDelegate () @end @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; self.window.rootViewController = [[RootViewController alloc] init]; [self.window makeKeyAndVisible]; return YES; } @end
#import <UIKit/UIKit.h> @interface RootViewController : UIViewController @end
#import "RootViewController.h" @interface RootViewController () @property (nonatomic , strong) UIWebView *webView; @end @implementation RootViewController - (void)viewDidLoad { [super viewDidLoad]; //html在本地的路径(/Users/apple/WebstormProjects/LoginPage/Login.html) NSURL *url = [NSURL fileURLWithPath:@"/Users/apple/WebstormProjects/LoginPage/Login.html"]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; UIWebView *aWebView = [[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.webView = aWebView; [self.webView loadRequest:request]; [self.view addSubview:self.webView]; } @end
相关文章推荐
- iOS web view 加载本地HTML页面不显示问题
- iOS UIWebView加载本地HTML页面规避js、css的缓存
- ios App加载本地HTML网页,点击网页链接跳转到app页面的方法
- ios的webView加载本地html图片路径显示及webview适配
- webview html页面加载本地js及img src(一)
- ios 加载本地html css文件 ps:css和html必须在同一文件夹下面
- IOS开发之路二十一(UIWebView加载本地html)
- 在FF中浏览本地HTML页面,该页面中的js未加载远程数据的解决办法。
- ios webView 加载本地html5
- ios html 加载本地图片
- webview html页面加载本地js及img src
- iOS webView 远程html加载本地资源
- Windows Phone 用WebBrowser加载本地图片以及解决加载html页面出现乱码问题
- ios中UIWebView加载本地HTML,以及其中的JavaScript方法的调用
- iOS 加载本地html文件详细操作
- IOS学习之WebView加载本地HTML代码或网络资源
- [IOS]UIWebView 请求网络页面或者加载本地资源页面
- [IOS]UIWebView 请求网络页面或者加载本地资源页面
- webview html页面加载本地js及img src(二)
- ios UIWebView 加载本地html,js,css文件的问题