.AppDelegate.m

   #import “OneViewController.h”
//一打开就运行的
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen]bounds]];
OneViewController *oneController = [[OneViewController alloc] init];
[self.window setRootViewController:oneController];
[self.window makeKeyAndVisible];
return YES;
} .OneViewController.m #import “TwoViewController.h”
-(void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor orangeColor]; [self OneButton];
}
//添加button
#pragma mark – Button
-(void)OneButton
{
UIButton *myButton = [[UIButton alloc] init];
myButton.frame = CGRectMake(,300,90,35);
myButton.backgroundColor = [UIColor grayColor];
[myButton setTitle:”确定” forState:UIControlStateNormal];
[self.view.addSubview:myButton];
//addSubview: 添加一个视图对接收者的子视图列表。
[myButton addTarget:self action:@selector(ClickMyButton) forControlEvents:UIControlEventTouchUpInside];
//addTarget: 将目标对象和动作方法与控制关联。
}
//Button点击事件
#pragma mark - Button
-(void)ClickButton
{
TwoViewController *two = [[TwoViewController alloc] init];
//跳转到下一页面
  [self presentViewController:two animated:YES completion:nil];
}
//跳转到上一页面
[self dismissViewControllerAnimated:YES completion:nil]; .Label [self label1]; -(void)Label
{
UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(,,,)];
label1.backgroundColor = [UIColor whiteColor];
label1.text = @”显示”;
label1.textColor = [UIColor blackColor];
[self.view addSubview:label1];
} .TextField [self _text]; -(void)TextField
{
_text = [[UITextField alloc] initWithFrame:CGRectMake(,,,)];
_text.borderStyle = UITextBorderStyleRoundedRect;
_text.backgroundColor = [UIColor whiteColor];
_text.placeholder = @”请输入密码”;
_text.textColor = [UIColor blackColor];
_text.keyboardType = UIKeyboardTypeDefault;
_text.returnKeyType = UIReturnKeyGo;
[self.view addSubview:_text];
}

button、label、textfield、页面跳转、传值的更多相关文章

  1. iOS 页面跳转传值,属性传值,代理传值,代码块传值,单例传值,通知传值

    有时候我们在页面跳转的时候回传递相应的参数,如,你想把在第一个页面的文本框里的内容显示在第二个文本框中,或者你又想把第二个文本框中的内容改变之后到第一个页面的文本框中,所有,这个时候我们就要用到页面跳 ...

  2. UWP 页面跳转传值

    如果涉及到页面跳转,一般用Frame这个控件来管理不同的页面. <Grid Name="RootGrid"> <Frame Name="RootFram ...

  3. storyboard页面跳转传值

    受学姐的影响,习惯纯代码编程,这次要修改别人的代码,很多编程风格还不习惯. 在此之前,页面跳转我都用的是Navigation,故事板上的页面跳转带传值,让我卡了好半天. 页面跳转: [self per ...

  4. MUI框架开发HTML5手机APP(二)--页面跳转传值&底部选项卡切换

      概 述 JRedu 在上一篇博客中,我们学习了如何使用Hbuilder创建一个APP,同时如何使用MUI搭建属于自己的第一款APP,没有学习的同学可以戳链接学习: http://www.cnblo ...

  5. PHP页面跳转传值的三种常见方式

    一. POST传值 post传值是用于html的<form>表单跳转的方法,很方便使用.例如: ? 1 2 3 4 5 6 7  <html>  <form action ...

  6. 点击Button按钮实现页面跳转

    1.首先我们新建一个带有button按钮的页面 <button type="submit" class="form-contrpl">注册</ ...

  7. ionic4 页面跳转传值和新页面取值

    页面跳转 : <ion-row *ngFor="let item of aboutData.stockData" [routerLink]="[ '/stock-d ...

  8. asp.net 页面跳转传值的几种方式

    参考地址: http://blog.csdn.net/zzzzzzzert/article/details/8486143 protected void Button1_Click(object se ...

  9. .Net中几种常见的页面跳转传值方法

    1.ASP Server对象Execute方法 ASP Server对象的Execute方法可以在执行当前页面的过程中将另一个页面执行结果的内容插入到当前页面的输出中.Execute方法带一个参数,是 ...

  10. 微信小程序——页面跳转传值

    比如从index.wxml跳转到aaa.wxml index.wml <navigator url="../aaa/aaa?id=1" > </navigator ...

随机推荐

  1. Android Studio tips1

    Android Studio 真机测试出现  device can not found 1.安装与手机版本一样的sdk 2.(重要!!)手机的驱动在电脑上没有正确的安装,安装豌豆荚可以解决!

  2. Chrome浏览器官方下载地址

    Chrome浏览器离线安装包官方下载地址,和在线安装一样能自动更新. 正式版 http://www.google.com/chrome/eula.html?hl=zh-CN&standalon ...

  3. GridView控件RowDataBound事件中获取列字段途径

    今天不知道怎么回事怎么也找不到gridview列中的控件,关键是其为编辑时隐藏域中的控件,取值就很成问题了,网上搜了很到,找到这个比较经典的东东了,可能大家都知道,但很少对比整理到一起,有多种方法可以 ...

  4. VC++ 迭代器 iterator, const_iterator, const iterator

    迭代器 iterator, const_iterator, const iterator 迭代器iterator的作用类似于指针. (1)iterator只有针对制定<类型>的容器才有效. ...

  5. DataSet读取数据

    using System.Data; using System.Data.SqlClient; namespace ConsoleApplication3 { class Program { stat ...

  6. 重写form 表单的验证信息

    (function($) { var isformValidationPostBack=true; var isformValidation = false; $.extend({ formValid ...

  7. BZOJ1801:[Ahoi2009]chess 中国象棋

    Time Limit: 10 Sec  Memory Limit: 64 MB Description 在N行M列的棋盘上,放若干个炮可以是0个,使得没有任何一个炮可以攻击另一个炮. 请问有多少种放置 ...

  8. 用Java写算法之归并排序

    转自:http://flyingcat2013.blog.51cto.com/7061638/1281026 前面的三种排序算法(冒泡排序,选择排序,插入排序)在平均情况下均为O(n^2)复杂度,在处 ...

  9. 多线程爬取 threading.Thread 文件名支持gbk编码

    # - *- coding:utf-8-*-import urllib2import reimport osimport threadingimport sysreload(sys)sys.setde ...

  10. ORACLE临时表空间

    ORACLE临时表空间总结 2014-10-05 11:35 by 潇湘隐者, 临时表空间概念 临 时表空间用来管理数据库排序操作以及用于存储临时表.中间排序结果等临时对象,当ORACLE里需要用到S ...