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 ...
随机推荐
- GlusterFS创建volume失败的解决方法(* or a prefix of it is already part of a volume)
问题描写叙述: 之前已经创建了一个replicated的volume gv0,replica=2,两个文件夹为:/test/data1和/test/data2,之后发现这两个文件夹不太合适,想在/te ...
- 微信公共服务平台开发(.Net 的实现)6-------自定义菜单
用户自定义菜单制作时,需要用到access_token,我们直接使用前面讲解的IsExistAccess_Token()函数.我理解的微信公共平台里面菜单分为button和sub_button,即菜单 ...
- HTML的disabled属性及readonly属性
disabled属性的input不会提交到服务器. readonly属性的input会提交到服务器.
- iOS开发——图层OC篇&UIColor深入研究(CGColor,CIColor)
UIColor深入研究(CGColor,CIColor) 由于跟人比较喜欢研究关于图层与动画方面的技术,正打算看看别人写的好东西,就遇到了好几个问题, 第一:UIClor类方法的使用 就是关于UICo ...
- NSNotificationCenter通知中心
概述 NSNotificationCenter通知中心,通常用于一对一或者一对多的消息传递,即当一个地方改变时,要求改变其他的一些地方,例如当网络请求回来了新的数据,需要刷新本地信息和本地内存里面的界 ...
- oracle数据迁移
通过这个文章演示一下Oracle的表空间迁移流程以及需要注意的诸多事项. 实验目标:将ora10g数据库实例上的表空间TBS_SEC_D迁移到secooler数据库实例上操作系统:Redhat 5.3 ...
- php 换行 空格分割处理
<?php function parse_specification($specification){ $rt=array(); $lines=array_filter(preg_split(& ...
- java 考试试题
Java基础部分 基础部分的顺序:基本语法,类相关的语法,内部类的语法,继承相关的语法,异常的语法,线程的语法,集合的语法,io 的语法,虚拟机方面的语法,其他.有些题来自网上搜集整理,有些题来自学员 ...
- LeetCode3 Longest Substring Without Repeating Characters
题意: Given a string, find the length of the longest substring without repeating characters. Examples: ...
- C#属性(Attribute)用法实例解析
属性(Attribute)是C#程序设计中非常重要的一个技术,应用范围广泛,用法灵活多变.本文就以实例形式分析了C#中属性的应用.具体入戏: 一.运用范围 程序集,模块,类型(类,结构,枚举,接口,委 ...