iOS--APP 登录界面图(xuer)
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)的更多相关文章
- 仿知乎app登录界面(Material Design设计框架拿来就用的TexnInputLayout)
在我脑子里还没有Material Design这种概念,就我个人而言,PC端应用扁平化设计必须成为首选,手当其冲的两款即时通讯旺旺和QQ早就完成UI扁平化的更新,然而客户端扁平化的设计本身就存在天生的 ...
- iOS app应用界面加载卡顿的问题
刚发布版本,忽然发现加载界面需要3-5秒延迟,那么问题来了. 首先,发现问题: 1.看代码,基于之前版本更新都没出问题,还是比较确信不是代码中的bug,以防万一,还是仔细看了下关于界面跳转部分的代码, ...
- 如何设计App登录模块?
1.熟悉目前常见的手机APP登陆方式 ① 账号登陆(手机.邮箱) ② 第三方登陆(微信,QQ,微博) ③ 一键快捷登录(工具类,如不记单词) ④ 游客登陆(bbs) ⑤ demo测试登陆(如友盟等) ...
- 萌货猫头鹰登录界面动画iOS实现分析
动画效果仿自国外网站readme.io的登录界面,超萌可爱的猫头鹰,具体效果如下图所示. 动画实现核心: 动画核心的是用到了iOS中UIView的transform属性,然后根据尺寸坐标对四张图片进行 ...
- [IOS NSUserDefaults]的使用:登陆后不再显示登录界面。
之前搜了好多地方都没找到实现“登陆后不再显示登录界面,而默认自动登录”的方法. 待我发现有种存储方式叫NSUserDefaults的时候,立马又感觉新技能get了. 简介: NSUserDefault ...
- iOS开发UI篇—模仿ipad版QQ空间登录界面
iOS开发UI篇—模仿ipad版QQ空间登录界面 一.实现和步骤 1.一般ipad项目在命名的时候可以加一个HD,标明为高清版 2.设置项目的文件结构,分为home和login两个部分 3.登陆界面的 ...
- jquery自己主动旋转的登录界面的背景代码登录页背景图
在其他网站上看到比较爽Web登录界面.背景图片可以自己主动旋转. 介绍给大家.有兴趣的可以改改下来作为自己的系统登录界面. 如图: watermark/2/text/aHR0cDovL2Jsb2cuY ...
- iOS中三种方式实现登录界面播放视频或gif效果
现在app都做的越来越炫酷,各种动画效果,各种特效很好的提高了用户的体验.很多app在登录界面都使用了动画效果,比如Uber,Keep,QQ等等.这些动画效果基本都是使用gif或者MP4来实现的. 效 ...
- 1、IOS开发--iPad之仿制QQ空间(登录界面搭建+登录逻辑实现)
开始搭建登录界面 登录界面效果图: 相关的图片资源下载百度云备份链接: http://pan.baidu.com/s/1o71cvMU 密码: 2h7e 步骤开始: 设置辅助窗口的位置在下方 快捷键o ...
随机推荐
- 关于win7和xp的屏设置类
DisplayInfo.h #pragma once enum WinVerDef { WIN_VER_UNKNOWN = -, WIN_VER_95 = , WIN_VER_98, WIN_VER_ ...
- Knockout 新版应用开发教程之Observable与computed
KO是什么? KO不是万能的,它的出现主要是为了方便的解决下面的问题: UI元素较多,用户交互比较频繁,需要编写大量的手工代码维护UI元素的状态.样式等属性? UI元素之间关系比较紧密,比如操作一个元 ...
- 15套精美的免费界面设计 PSD 素材【免费下载】
在这个集合中,我们聚集15套精美的 PSD 界面设计模板,网页元素,用户界面工具包,扁平化图标,APP 应用程序 UI 设计的等等.这些来自优秀设计师的 PSD 源文件素材让其它的设计师们在设计用 ...
- Linux基本操作命令总结
1.命令基本格式 root用户:[root@localhost ~] # 或者普通用户:[hadoop@localhost ~] $ 用户@主机名 目录 [#|$]管理员类型 ...
- ASP.NET 文件上传类 简单好用
调用: UploadFile uf = new UploadFile(); /*可选参数*/ uf.SetIsUseOldFileName(true);//是否使用原始文件名作为新文件的文件名(默认: ...
- 移动端前端常见的触摸相关事件touch、tap、swipe等整理
前端的很多事件在PC端和浏览器端可公用,但有些事件却只在移动端产生,如触摸相关的事件 本文整理了移动端常见的一些事件,包括原生支持的click.touch.tap.swipe事件,也有定义型的gest ...
- thread_AtomicBoolean
Boolean值的变化的时候不允许在之间插入,保持操作的原子性 它提供了原子性操作,其中exists.compareAndSet(false, true)这个操作把比较和赋值操作组成了一个原子操作,中 ...
- python学习笔记 - 初识socket
socket socket通常也称作"套接字",用于描述IP地址和端口,是一个通信链的句柄,应用程序通常通过"套接字"向网络发出请求或者应答网络请求. sock ...
- 【C#】线程之Task
Task开启线程 有两种启动方式: 1.构造创建线程,然后启动 var taskForAction = new Task(() => { //do something }); taskForAc ...
- C#开发体感游戏 Kinect应用知识
Kinect首先是一个XBox 360外接体感设备,通过无线方式捕捉动作感知.由PrimeSense提供Range Camera技术,同类产品如任天堂Wii.Play Station Move,必须让 ...