




下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
【移动应用开发技术】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年中国音箱油漆行业投资前景及策略咨询研究报告
- 2025年中国立体十相自在手镯行业投资前景及策略咨询研究报告
- 2025年中国热缩包装设备行业投资前景及策略咨询研究报告
- 2025年中国提花丝绒带行业投资前景及策略咨询研究报告
- 2025年中国中空纤维过滤器行业投资前景及策略咨询研究报告
- 2025届河南濮阳市高二化学第二学期期末监测模拟试题含解析
- 导游模拟考试题库及答案
- 护理事业十五五发展规划(2026-2030)
- 人教版(2024)七年级下册英语全册教案(8个单元整体教学设计)
- 10kV小区供配电设计、采购、施工EPC投标技术方案技术标
- yamaha贴片机操作规程
- 管道护理业务学习课件
- 新求精德语强化教程初级1(第四版)
- GB/T 18601-2001天然花岗石建筑板材
- 中小学校长公开招聘理论考试(试卷)
- 汽封加热器 说明书
- 07劳动力及资源配备计划
- 精馏-化工分离工程课件
评论
0/150
提交评论