.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. Lambda GroupBy Sum

    DataTable dt = new DataTable(); dt.AsEnumerable().GroupBy(r => r["ShopName"]) .Select(g ...

  2. EntityFramework Reverse POCO Generator工具

    https://visualstudiogallery.msdn.microsoft.com/ee4fcff9-0c4c-4179-afd9-7a2fb90f5838

  3. Visual Studio 2015激活码,Visual Studio 2015密钥

    微软刚刚为开发人员奉上了最新大礼Visual Studio 2015正式版.如果你是MSDN订阅用户,现在就可以去下载丰富的相关资源.如果你指向体验一把尝尝鲜,微软也是很慷慨的. Visual Stu ...

  4. IOS系列swift语言之课时四

    今天我们要讲的主要有:下标.可为空的类型.枚举(特殊的枚举:递归枚举).原生值.关联值 首先来分析一下这个下标,就是说我们可以通过下标找到对应的值或者是改变对应的值. 其次是可为空的类型,我们要牢记所 ...

  5. jquery-1.3.2.js

    Uncaught SyntaxError: Unexpected identifier

  6. python Day01

    Python Day01 Python 简介 介绍 Python 是一种面向对象.直译式的计算机程序设计语言,也是一种功能强大的通用型语言,已经有将近二十年的发展历史,成熟稳定.包含了一组完善而且容易 ...

  7. apache目录浏览

    DocumentRoot "/Library/WebServer/Documents" <Directory "/Library/WebServer/Documen ...

  8. hdu5452 Minimum Cut

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5452 题意:给你一个图和它的生成树,要你在树上删一条边,问你最少删多少条边使得图不联通(开始时图一定联 ...

  9. LLVM example for main

    #include "llvm/IR/CallSite.h" #include "llvm/IR/Instruction.h" #include "ll ...

  10. Java调用第三方dll文件的使用方法 System.load()或System.loadLibrary()

    Java调用第三方dll文件的使用方法 public class OtherAdapter { static { //System.loadLibrary("Connector") ...