ViewController.h


#import "ViewController.h"

@interface ViewController ()

@property(strong,nonatomic)UIImageView *beijing;
@property(strong,nonatomic) UIImageView *welcome;
@property(strong,nonatomic) UIImageView *phoneIcon;
@property(strong,nonatomic)UITextField *Intele;
@property(strong,nonatomic) UIView *InteleView;
@property(strong,nonatomic) UIImageView *passwordIcon;
@property(strong,nonatomic) UITextField *Inpassword;
@property(strong,nonatomic) UIView *InpasswordView;
@property(strong,nonatomic) UIImageView *logo;
@property(strong,nonatomic) UIButton *loginButton;
@property(strong,nonatomic) UIButton *rigisterButton; @end

ViewController.m


@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];
// 添加父视图beijing背景图
self.beijing=[[UIImageView alloc] initWithFrame:CGRectMake(, , self.view.frame.size.width, self.view.frame.size.height)];
// 插入图片
[self.beijing setImage:[UIImage imageNamed:@"beijing"]];
[self.view addSubview:self.beijing]; // 添加子视图welcome背景图
self.welcome=[[UIImageView alloc] initWithFrame:CGRectMake(, , , )];
// 插入图片
[self.welcome setImage:[UIImage imageNamed:@"welcome"]];
// 插入子视图
[self.view addSubview:self.welcome]; // 添加phoneIcon输入图标
self.phoneIcon=[[UIImageView alloc] initWithFrame:CGRectMake(, , , )];
// 插入图片
[self.phoneIcon setImage:[UIImage imageNamed:@"phoneIcon"]];
[self.view addSubview:self.phoneIcon]; // 添加手机号码输入框
self.Intele=[[UITextField alloc] initWithFrame:CGRectMake(, , , )];
// 设置隐身字
self.Intele.placeholder=@"请输入手机号码";
// 设置数字弹出键盘
self.Intele.keyboardType=UIKeyboardTypeNumberPad;
// 设置无边框的UITextField
self.Intele.borderStyle=UITextBorderStyleNone;
[self.view addSubview:self.Intele];
self.InteleView=[[UIView alloc] initWithFrame:CGRectMake(, , , )];
self.InteleView.backgroundColor=[UIColor whiteColor];
[self.view addSubview:self.InteleView]; // 添加密码输入框
self.Inpassword=[[UITextField alloc] initWithFrame:CGRectMake(, , , )];
self.Inpassword.placeholder=@"请输入密码";
self.Inpassword.secureTextEntry=YES;
self.Inpassword.borderStyle=UITextBorderStyleNone;
[self.view addSubview:self.Inpassword]; self.InpasswordView=[[UIView alloc] initWithFrame:CGRectMake(, , , )];
self.InpasswordView.backgroundColor=[UIColor whiteColor];
[self.view addSubview:self.InpasswordView]; // 添加passwordIcon输入图标
self.passwordIcon=[[UIImageView alloc] initWithFrame:CGRectMake(, , , )];
[self.passwordIcon setImage:[UIImage imageNamed:@"passwordIcon"]];
[self.view addSubview:self.passwordIcon]; // 添加logo背景图
self.logo=[[UIImageView alloc] initWithFrame:CGRectMake(, , , )];
[self.logo setImage:[UIImage imageNamed:@"logo"]];
[self.view addSubview:self.logo]; // 登录按钮的相关设置
self.loginButton=[[UIButton alloc] initWithFrame:CGRectMake(, , , )];
[self.loginButton setBackgroundImage:[UIImage imageNamed:@"loginButton"] forState:UIControlStateNormal];
[self.loginButton setTitle:@"登录" forState:UIControlStateNormal];
// 事件监听
[self.loginButton addTarget:self action:@selector(hideKeyBoard) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:self.loginButton]; // 注册按钮的相关设置
self.rigisterButton=[[UIButton alloc] initWithFrame:CGRectMake(, , , )];
[self.rigisterButton setBackgroundImage:[UIImage imageNamed:@"rigisterButton"] forState:UIControlStateNormal];
[self.rigisterButton setTitle:@"注册" forState:UIControlStateNormal]; // 事件监听
[self.rigisterButton addTarget:self action:@selector(hideKeyBoard) forControlEvents:UIControlEventTouchUpInside];
[self.rigisterButton setTitleColor:[UIColor greenColor] forState:UIControlStateNormal];
[self.view addSubview:self.rigisterButton]; }
// 点击空白区域 隐藏键盘
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
[self hideKeyBoard];
} -(void)hideKeyBoard
{
if ([self.Intele isFirstResponder]||[self.Inpassword isFirstResponder]){
[self.Intele resignFirstResponder];
[self.Inpassword resignFirstResponder];
} }

运行结果:

iOS--APP 登录界面图(xuer)的更多相关文章

  1. 仿知乎app登录界面(Material Design设计框架拿来就用的TexnInputLayout)

    在我脑子里还没有Material Design这种概念,就我个人而言,PC端应用扁平化设计必须成为首选,手当其冲的两款即时通讯旺旺和QQ早就完成UI扁平化的更新,然而客户端扁平化的设计本身就存在天生的 ...

  2. iOS app应用界面加载卡顿的问题

    刚发布版本,忽然发现加载界面需要3-5秒延迟,那么问题来了. 首先,发现问题: 1.看代码,基于之前版本更新都没出问题,还是比较确信不是代码中的bug,以防万一,还是仔细看了下关于界面跳转部分的代码, ...

  3. 如何设计App登录模块?

    1.熟悉目前常见的手机APP登陆方式 ① 账号登陆(手机.邮箱) ② 第三方登陆(微信,QQ,微博) ③ 一键快捷登录(工具类,如不记单词) ④ 游客登陆(bbs) ⑤ demo测试登陆(如友盟等) ...

  4. 萌货猫头鹰登录界面动画iOS实现分析

    动画效果仿自国外网站readme.io的登录界面,超萌可爱的猫头鹰,具体效果如下图所示. 动画实现核心: 动画核心的是用到了iOS中UIView的transform属性,然后根据尺寸坐标对四张图片进行 ...

  5. [IOS NSUserDefaults]的使用:登陆后不再显示登录界面。

    之前搜了好多地方都没找到实现“登陆后不再显示登录界面,而默认自动登录”的方法. 待我发现有种存储方式叫NSUserDefaults的时候,立马又感觉新技能get了. 简介: NSUserDefault ...

  6. iOS开发UI篇—模仿ipad版QQ空间登录界面

    iOS开发UI篇—模仿ipad版QQ空间登录界面 一.实现和步骤 1.一般ipad项目在命名的时候可以加一个HD,标明为高清版 2.设置项目的文件结构,分为home和login两个部分 3.登陆界面的 ...

  7. jquery自己主动旋转的登录界面的背景代码登录页背景图

    在其他网站上看到比较爽Web登录界面.背景图片可以自己主动旋转. 介绍给大家.有兴趣的可以改改下来作为自己的系统登录界面. 如图: watermark/2/text/aHR0cDovL2Jsb2cuY ...

  8. iOS中三种方式实现登录界面播放视频或gif效果

    现在app都做的越来越炫酷,各种动画效果,各种特效很好的提高了用户的体验.很多app在登录界面都使用了动画效果,比如Uber,Keep,QQ等等.这些动画效果基本都是使用gif或者MP4来实现的. 效 ...

  9. 1、IOS开发--iPad之仿制QQ空间(登录界面搭建+登录逻辑实现)

    开始搭建登录界面 登录界面效果图: 相关的图片资源下载百度云备份链接: http://pan.baidu.com/s/1o71cvMU 密码: 2h7e 步骤开始: 设置辅助窗口的位置在下方 快捷键o ...

随机推荐

  1. 【转】mysql如何跟踪执行的sql语句

    转自http://blog.csdn.net/testcs_dn/article/details/18791815 在SQL SERVER下跟踪sql采用事件探查器,而在mysql下如何跟踪sql呢? ...

  2. IDL中histogram的应用

    前面一段时间在使用Histogram时一直是不能更好的理解其中的奥秘,通过阅读帮助以及查看相应的文档,终于理解了其中的玄机,很多时候是因为在学习的时候英文不知道翻译成什么样的内容比较合理,这样就给后面 ...

  3. 玩转PowerShell第二节——【利用PsExec进行远程调用】-技术&分享

    概述 PowerShell用的最多的地方就是远程调用,在远程机器上执行脚本,监控远程机器的状态,如NLB状态,EventLog,SqlServer DataBase状态等. 本篇将讲到用PsExec. ...

  4. Web Fram 2 for IIS7.X(Microsoft Web Farm Framework)

    Microsoft Web Farm Framework (WFF) 2.0 是微软开发的.基于IIS 7.x的小插件,能够帮助我们轻松实现Web网站的高性能.高可用性,用来在Web服务器群上提供和管 ...

  5. 简单的session共享的封装

    目的 session存储在缓存服务器上(各种缓存服务器上均可,本文以memcached为例),但对开发者来说,他不用关注,只需要调用request.getSession()方法即可获取到session ...

  6. JS魔法堂:浏览器模式和文档模式怎么玩?

    一.前言 从IE8开始引入了文档兼容模式的概念,作为开发人员的我们可以在开发人员工具中通过“浏览器模式”和“文档模式”(IE11开始改为“浏览器模式”改成更贴切的“用户代理字符串”)品味一番,它的出现 ...

  7. jQuery的 delegate问题

    习惯了bind,用惯了live,就不习惯delegate了呀有木有... 支持为动态生成的标签元素绑定事件也许就live和delegate了吧,不过新版本已经不支持live了,只有delegate d ...

  8. 重新想象 Windows 8 Store Apps (34) - 通知: Toast Demo, Tile Demo, Badge Demo

    [源码下载] 重新想象 Windows 8 Store Apps (34) - 通知: Toast Demo, Tile Demo, Badge Demo 作者:webabcd 介绍重新想象 Wind ...

  9. 常用SQL查询语句

    一.简单查询语句 1. 查看表结构 SQL>DESC emp; 2. 查询所有列 SQL>SELECT * FROM emp; 3. 查询指定列 SQL>SELECT empmo, ...

  10. 【poj 3167】Cow Patterns(字符串--KMP匹配+数据结构--树状数组)

    题意:给2个数字序列 a 和 b ,问按从小到达排序后,a中的哪些子串与b的名次匹配. a 的长度 N≤100,000,b的长度 M≤25,000,数字的大小 K≤25. 解法:[思考]1.X 暴力. ...