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. MyBatis知多少(14)分散的数据库系统

    任何一个重要的数据库无疑都会拥有不止一个依赖者.即使该数据库只是简单地被两个Web 应用程序所共享,也有许多事情需要考虑.假设有一个名为网上购物车的Web应用程序,它使用了一个包含类别代码的数据库.就 ...

  2. 文本框不够长,显示“XXX...”

    WPF: How to make the TextBox/TextBlock/Label show "xxx..." if the text content too long? 设 ...

  3. 二叉搜索树BinarySearchTree(C实现)

    头文件—————————————————————————————— #ifndef _BINARY_SEARCH_TREE_H_ #define _BINARY_SEARCH_TREE_H_ #inc ...

  4. 二叉查找树(三)之 Java的实现

    概要 在前面分别介绍了"二叉查找树的相关理论知识,然后给出了二叉查找树的C和C++实现版本".这一章写一写二叉查找树的Java实现版本. 目录 1. 二叉树查找树2. 二叉查找树的 ...

  5. Awk by Example--转载

    原文地址: http://www.funtoo.org/Awk_by_Example,_Part_1?ref=dzone http://www.funtoo.org/Awk_by_Example,_P ...

  6. [Node.js] Promise,Q及Async

    原文地址:http://www.moye.me/2014/12/27/promise_q_async/ 引子 在使用Node/JS编程的时候,经常会遇到这样的问题:有一连串的异步方法,需要按顺序执行, ...

  7. IEE数据库kill指定条件的进程

    需求:IEE数据库临时需要添加一个监控,将command为sleep,time>1800,info为null的进程自动杀掉. 1.杀进程脚本ieekill.sh内容如下 #!/bin/bash ...

  8. struts.xml中出现Package struts2 extends undefined package struts-default解决办法

    在struts.xml中出现extends undefined package struts-default,经过查阅资料原来是因为没有联网的缘故.这样解决:在myeclipse中关联本地的dtd文件 ...

  9. 三分套三分 --- HDU 3400 Line belt

    Line belt Problem's Link:   http://acm.hdu.edu.cn/showproblem.php?pid=3400 Mean: 给出两条平行的线段AB, CD,然后一 ...

  10. LeetCode131:Palindrome Partitioning

    题目: Given a string s, partition s such that every substring of the partition is a palindrome. Return ...