下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
【移动应用开发技术】iOSUITextField或UITextView的内容是否为空
//判断正在编辑的UITextField或UITextView的内容是否为空,判断正在编辑的UITextField或UITextView的内容是否为空,以此来控制button的点亮状态#pragmamark-UITextFieldDelegate-(BOOL)textField:(UITextField
*)textFieldshouldChangeCharactersInRange:(NSRange)rangereplacementString:(NSString
*)string{
NSMutableString
*changedString=[[NSMutableString
alloc]initWithString:textField.text];
[changedString
replaceCharactersInRange:range
withString:string];
if
(changedString.length!=0){
self.navigationItem.rightBarButtonItem.enabled=YES;
}else{
self.navigationItem.rightBarButtonItem.enabled=NO;
}
returnYES;}#pragmamark-UITextViewDelegate-(BOOL)textView:(UITextView
*)textViewshouldChangeTextInRange:(NSRange)rangereplacementText:(NSString*)text{
NSMutableString
*changedString=[[NSMutableString
alloc]initWithString:textView.text];
[changedString
replaceCharactersInRange:range
withString:text];
if
(changedString.length!=0){
self.navigationItem.rightBarButtonItem.enabled=YES;
}else{
self.navigationItem.rightBarButtonItem.enabled=NO;
}
returnYES;}//一些判断技巧-(BOOL)verifyData{
if(tfPostName.text.length<1){
//01
tfPostName.layer.borderColor=[UIColorredColor].CGColor;
tfPostName.layer.borderWidth=1.0;
tfPostName.layer.cornerRadius=5.0;
returnNO;
}
elseif(tfPositionType.text.length<1){
//02
tfPositionType.layer.borderColor=[UIColorredColor].CGColor;
tfPositionType.layer.borderWidth=1.0;
tfPositionType.layer.cornerRadius=5.0;
returnNO;
}
elseif(tfPeopleNum.text.length<1){
//03
tfPeopleNum.layer.borderColor=[UIColorredColor].CGColor;
tfPeopleNum.layer.borderWidth=1.0;
tfPeopleNum.layer.cornerRadius=5.0;
returnNO;
}
elseif(tfWages.text.length<1){
//04
tfWages.layer.borderColor=[UIColorredColor].CGColor;
tfWages.layer.borderWidth=1.0;
tfWages.layer.cornerRadius=5.0;
returnNO;
}elseif(tfUnit.text.length<1){
//05
tfUnit.layer.borderColor=[UIColorredColor].CGColor;
tfUnit.layer.borderWidth=1.0;
tfUnit.layer.cornerRadius=5.0;
returnNO;
}elseif(tfStartDate.text.length<1){
//07
tfStartDate.layer.borderColor=[UIColorredColor].CGColor;
tfStartDate.layer.borderWidth=1.0;
tfStartDate.layer.cornerRadius=5.0;
returnNO;
}elseif(tfEndDate.text.length<1){
//08
tfEndDate.layer.borderColor=[UIColorredColor].CGColor;
tfEndDate.layer.borderWidth=1.0;
tfEndDate.layer.cornerRadius=5.0;
returnNO;
}elseif(tfSescribe.text.length<1){
//09
tfSescribe.layer.borderColor=[UIColorredColor].CGColor;
tfSescribe.layer.borderWidth=1.0;
tfSescribe.layer.cornerRadius=5.0;
//tfSescribe.text.length==0;
returnNO;
}//
}elseif(tfPayWay.text.length<1){
//tfSescribe
//
//10--//
tfPayWay.layer.borderColor=[UIColorredColor].CGColor;//
tfPayWay.layer.borderWidth=1.0;//
tfPayWay.layer.cornerRadius=5.0;//
returnNO;//
//
}
elseif(tfContactPerson.text.length<1){
//11
tfContactPerson.layer.borderColor=[UIColorredColor].CGColor;
tfContactPerson.layer.borderWidth=1.0;
tfContactPerson.layer.cornerRadius=5.0;
returnNO;
}
elseif(tfContactPhone.text.length<1){
//12--
tfContactPhone.layer.borderColor=[UIColorredColor].CGColor;
tfContactPhone.layer.borderWidth=1.0;
tfContactPhone.layer.cornerRadius=5.0;
returnNO;
}elseif(tfJobArea.text.length<1){
//13
tfJobArea.layer.borderColor=[UIColorredColor].CGColor;
tfJobArea.layer.borderWidth=1.0;
tfJobArea.layer.cornerRadius=5.0;
returnNO;
}
elseif(tfDetailAddress.text.length<1){
//14--
tfDetailAddress.layer.borderColor=[UIColorredColor].CGColor;
tfDetailAddress.layer.borderWidth=1.0;
tfDetailAddress.layer.cornerRadius=5.0;
returnNO;
}elseif(tfUnit.text.length<1){
//15
tfUnit.layer.borderColor=[UIColorredColor].CGColor;
tfUnit.layer.borderWidth=1.0;
tfUnit.layer.cornerRadius=5.0;
returnNO;
}
else{
returnYES;
}
}//岗位描述不能为空的判断#pragmamark-UITextViewDelegate-(BOOL)textView:(UITextView*)textViewshouldChangeTextInRange:(NSRange)rangereplacementText:(NSString*)text{
NSMutableString*changedString=[[NSMutableStringalloc]initWithString:tfSescribe.text];
[changedStringreplaceCharactersInRange:rangewithString:text];
if(changedString.length<1){
//self.navigationItem.rightBarButtonItem.e
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 广西壮族自治区特种设备检验研究院2025年下半年公开招聘工作人员备考题库参考答案详解
- 厦门大学附属第一医院漳州招商局开发区分院2025年第四批公开招聘编外工作人员备考题库及1套参考答案详解
- 2026年医院清真食堂装修合同
- 2026年线上咨询机构合同
- 宁海农村商业银行2026年招聘10人备考题库及完整答案详解1套
- 2025年滁州市公安机关公开招聘警务辅助人员50人备考题库有答案详解
- 航天科工微电子系统研究院有限公司2026年校园招聘5人备考题库完整答案详解
- 中微公司核心装备技术领先研发与团队夯实成长根基
- 2025年杭州极弱磁场重大科技基础设施研究院校园招聘备考题库及参考答案详解一套
- 中国人民银行清算总中心所属企业城银清算服务有限责任公司2026年校园招聘16人备考题库带答案详解
- GB/T 14364-1993船舶轴系滑动式中间轴承
- 核对稿-700单元联锁
- 肺炎教学查房课件
- 仪表设备管路脱脂方案(中英)
- 分析青花瓷在幼儿园美术活动中的应用
- 山塘整治工程建设方案
- 中国医院质量安全管理 第4-6部分:医疗管理 医疗安全(不良)事件管理 T∕CHAS 10-4-6-2018
- 电泳线点检表
- 基于Multisim的数字电子时钟设计报告
- 股东合作协议(三人)
- SBA40D生物传感分析仪使用说明
评论
0/150
提交评论