一,效果图。

二,工程图。

三,代码。

RootViewController.h

#import <UIKit/UIKit.h>

@class BECheckBox;
@interface RootViewController : UIViewController
{
BECheckBox *passwordCheck;
}
@property(nonatomic,retain)BECheckBox *passwordCheck; @end

RootViewController.m

#import "RootViewController.h"
//加入头文件
#import "BECheckBox.h" @interface RootViewController () @end @implementation RootViewController
@synthesize passwordCheck; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
} - (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view. //隐藏导航条
self.navigationController.navigationBarHidden=YES; //忘记密码按钮
BECheckBox *passCheckBox=[[BECheckBox alloc]initWithFrame:CGRectMake(61, 55, 80, 30)];
[passCheckBox setTitle:@"记住密码" forState:UIControlStateNormal];
[passCheckBox setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
passCheckBox.titleLabel.font=[UIFont systemFontOfSize:16];
[passCheckBox setTarget:self fun:@selector(passCheckBoxClick)];
passCheckBox.backgroundColor=[UIColor clearColor];
self.passwordCheck=passCheckBox;
[self.view addSubview:self.passwordCheck]; }
//记住密码点击
-(void)passCheckBoxClick
{
if ([self.passwordCheck isChecked]) {
NSLog(@"记住密码");
}
else {
NSLog(@"取消记住密码");
}
} - (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
 
 

【代码笔记】iOS-忘记密码选择整体button的更多相关文章

  1. 【代码笔记】iOS-单项选择框

    一,效果图. 二,工程图. 三,代码. RootViewController.h #import <UIKit/UIKit.h> @interface RootViewController ...

  2. 【代码笔记】iOS-时间选择框

    一, 效果图. 二,工程图. 三,代码. RootViewController.h #import <UIKit/UIKit.h> @interface RootViewControlle ...

  3. 【代码笔记】iOS-自定义选择框(高底强弱)

    一,效果图 二,代码. ViewController.h #import <UIKit/UIKit.h> @interface ViewController : UIViewControl ...

  4. 【代码笔记】iOS-给密码进行加密

    一,工程图. 二,代码. #import "ViewController.h" #import "Base64CodeByteFunc.h" @interfac ...

  5. 【代码笔记】iOS-自定义选择框

    一,效果图. 二,工程图. 三,代码. RootViewController.h #import <UIKit/UIKit.h> #import "CYCustomMultiSe ...

  6. 【代码笔记】Web-CSS-CSS组合选择符

    一,效果图. 二,代码. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...

  7. java web实现 忘记密码(找回密码)功能及代码

    java web实现 忘记密码(找回密码)功能及代码 (一).总体思路 (二).部分截图 (三).部分代码 (一).总体思路: 1.在 找回密码页面 录入 姓名.邮箱和验证码,录入后点击[提交]按钮, ...

  8. JavaMail学习笔记(七)、帐号激活与忘记密码 实例(zhuan)

    一.帐户激活   在很多时候,在某些网站注册一个用户之后,网站会给这个用户注册时填写的email地址发送一封帐户激活邮件,这封邮件的内容就是一个激活帐户的链接和一段简短的文字描述,如果用户没有去邮箱将 ...

  9. DW网页代码笔记

    DW网页代码笔记 1.样式.       class  插入类样式  标签技术(html)解决页面的内容样式技术(css)解决页面的外观脚本技术       解决页面动态交互问题<form> ...

随机推荐

  1. TSQL语句

    1.创建数据库create database test3;2.删除数据库drop database test3;3.创建表create table test(    code varchar(20), ...

  2. 辨析relative与absolute

    谈起它们,想必大家都不陌生.relative,相对定位嘛:absolute,绝对定位嘛.但是它们到底是个啥东东呢? 看看w3c的定义,见下表 定位 含义 relative 元素框偏移某个距离.元素仍保 ...

  3. 巧用css提高浏览器兼容性

    body,div,ul,ol,li,dl,dt,dd,h1,h2,h3,h4,h5,h6,form,input,textarea,p{ margin:0px; padding:0px; font-si ...

  4. Golang类型转换

    类型转换 1.int转string strconv.Itoa(i) 2.string转int i, err = strconv.Atoi(s) 或者 i, err = ParseInt(s, 10, ...

  5. ModelState.IsValid总为false原因

    总结在开发中遇到的一个问题 ModelState.IsValid 一直是false 且在局部变量中,没有发现有问题啊,Model非常正常有木有,可是为什么 ModelState.IsValid 总是f ...

  6. ZOJ Problem Set - 1383 Binary Numbers

    水题,输出的时候注意下 #include <stdio.h> #include <math.h> int main() { int d; scanf("%d" ...

  7. 1Z0-053 争议题目解析541

    1Z0-053 争议题目解析541 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 541.If you use ALTER DISKGROUP ... ADD DISK and s ...

  8. 相克军_Oracle体系_随堂笔记008-存储结构

    控制文件.数据文件.日志文件    放在存储上.   参数文件:数据库启动时读取,并不关闭,但是启动过后丢了也没事.一般放在服务器上. $ORACLE_HOME/dbs下   备份文件{     控制 ...

  9. jquery自定义滚动条 鼠标移入或滚轮时显示 鼠标离开或悬停超时时隐藏

    一.需求: 我需要做一个多媒体播放页面,左侧为播放列表,右侧为播放器.为了避免系统滚动条把列表和播放器隔断开,左侧列表的滚动条需要自定义,并且滚动停止和鼠标离开时要隐藏掉. 二.他山之石: 案例来自h ...

  10. Node.js连接Mysql,并把连接集成进Express中间件中

    引言 在node.js连接mysql的过程,我们通常有两种连接方法,普通连接和连接池. 这两种方法较为常见,当我们使用express框架时还会选择使用中间express-myconnection,可以 ...