XibDemo
//
// MyviewViewController.h
// XibDemo
//
// Created by hehe on 15/9/21.
// Copyright (c) 2015年 wang.hehe. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface MyviewViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIButton *Go;
- (IBAction)onclic:(id)sender;
@property (weak, nonatomic) IBOutlet UITextField *textfield1;
@property (weak, nonatomic) IBOutlet UIWebView *web;
@end
//
// MyviewViewController.m
// XibDemo
//
// Created by hehe on 15/9/21.
// Copyright (c) 2015年 wang.hehe. All rights reserved.
//
#import "MyviewViewController.h"
@interface MyviewViewController ()
@end
@implementation MyviewViewController
- (void)viewDidLoad {
[super viewDidLoad];
}
- (IBAction)onclic:(id)sender {
NSURL *url = [NSURL URLWithString:_textfield1.text];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[_web loadRequest:request];
[_textfield1 resignFirstResponder];
}
@end
//在appdelegate中的代码
//
// AppDelegate.m
// XibDemo
//
// Created by qianfeng on 15/9/21.
// Copyright (c) 2015年 qianfeng. All rights reserved.
//
#import "AppDelegate.h"
#import "MyviewViewController.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds] ];
self.window.backgroundColor = [UIColor whiteColor];
// ViewController *vc = [[ViewController alloc]init];
MyviewViewController *vc = [[MyviewViewController alloc] initWithNibName:@"MyviewViewController" bundle:nil];
self.window.rootViewController = vc;
[self.window makeKeyAndVisible];
return YES;
}
@end
XibDemo的更多相关文章
- iOS Xib布局某些控件显示或隐藏<约束的修改>
对于这个问题使用Masonry是很好解决的. 注意:绿色的是label2,当indexpath.section % 2 == 0时,label2不存在. 关键代码如下: if (indexPath.s ...
随机推荐
- 学渣告诉你,到底神马是傅里叶级数!转自 新浪@工程师style
- Citrix 服务器虚拟化之二十七 XenApp6.5发布服务器桌面
Citrix 服务器虚拟化之二十七 XenApp6.5发布服务器桌面 XenApp可发布以下类型的资源向用户提供信息访问,这些资源可在服务器或桌面上虚拟化: 1) 服务器桌面:发布场中服务器的整个 ...
- ActivityGroup+LinearLayout实现iphone风格的底部tab菜单
public class ActsGroup extends ActivityGroup { private LinearLayout bodyView; private Line ...
- data URI scheme
优化网页效能,首要的任务是尽量减少HTTP请求(http request)的次数,例如把多个JavaScript文档合并,多个CSS文件合并等等.此外,还有有一种 data URL 的方法,可以直接把 ...
- linux下的十六进制编辑器---wxHexEdit
....其实wxHexEdit是一个跨平台的十六进制编辑器,支持windows,linux,mac. 之所以标题用linux...是因为windows下多数都用winhex,UE之类的编辑器,而lin ...
- Golang学习 - io/ioutil 包
------------------------------------------------------------ // Discard 是一个 io.Writer 接口,调用它的 Write ...
- Ubuntu上手动安装nginx
最近需要利用nginx上搭建一个网站,因此在自己的电脑上安装了nginx,现在分享一下自己在安装过程及遇到的问题. 1.下载需要的nginx版本的安装包. axel -n http://nginx.o ...
- 关于yarn的spark配置属性
spark1.2.0 These are configs that are specific to Spark on YARN Property Name Default Meaning spark ...
- MySQL数据库还原:路径必须用正斜杠?
也是术业不精,其实之前也用命令行还原过几次MySQL数据库,但总记不清语法.这不,今天想把另一台电脑上备份的数据库还原过来,结果不停报错,如下图所示: 后来才发现,因为偷懒直接复制的路径名里,用的全是 ...
- Hastiness
Problem Description How many problems did you AC?When you read this problem, don’t hasty and careles ...