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. 【原创】C#搭建足球赛事资料库与预测平台(2) 数据库与XCode组件

            本博客所有文章分类的总目录:[总目录]本博客博文总目录-实时更新 开源C#彩票数据资料库系列文章总目录:[目录]C#搭建足球赛事资料库与预测平台与彩票数据分析目录  本篇文章开始将逐步 ...

  2. Java异步回调

      作者:禅楼望月(http://www.cnblogs.com/yaoyinglong) 1.开始讲故事: 午饭的时候到了,可是天气太冷,根本不想出办公室的门,于是你拨通了某饭店的订餐电话“喂!你好 ...

  3. 参数嗅探(Parameter Sniffing)(2/2)

    在参数嗅探(Parameter Sniffing)(1/2)里,我介绍了SQL Server里参数嗅探的基本概念和背后的问题.如你所见,当缓存的计划被SQL Server盲目重用时,会带来严重的性能问 ...

  4. 0316-复利计算器3.0---release

    目录       一.项目简介       二.Github链接推送       三.客户需求       四.需求分析       五.项目设计       六.完成效果       七.JUnit ...

  5. Windows 8.1 去掉库的方法

    Windows 8.1[这台电脑],  里面又多了[文件夹]分类,真是各种不习惯 删除方法: 打开注册表, 找到 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Wind ...

  6. AEAI BPM流程集成平台V3.0.2版本开源发布

    本次开源发布的是AEAI BPMV3.0.2版流程平台,该版本是数通畅联首次正式对外发布的版本,产品现已开源并上传至开源社区http://www.oschina.net/p/aeai-bpm. 产品说 ...

  7. css 样式表

    CSS(cascading style sheets,层叠样式表),作用是美化HTML网页. /*注释*/   注释语法 2.1 样式表的基本概念 2.1.1样式表的分类 1.内联样式表 和HTML联 ...

  8. 关于c++数的进制的经验

    默认状态下,数据按十进制输入输出.如果要求按八进制或十六进制输入输出,在cin或cout中必须指明相应的数据形式,oct为八进制,hex为十六进制,dec为十进制. 注意: 1.使用不带.h的头文件& ...

  9. WPF后台设置xaml控件的样式System.Windows.Style

    WPF后台设置xaml控件的样式System.Windows.Style 摘-自 :感谢 作者: IT小兵   http://3w.suchso.com/projecteac-tual/wpf-zhi ...

  10. Windows 64位操作系统和32位操作系统在注册表上的有一点不一样

    Windows 64位操作系统为提供对32位应用程序的兼容,在“C:\Windows\SysWOW64”目录下保留了很多32位的工具(如CMD.exe是32位的).在Windows 64位操作系统上跑 ...