付费下载
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
【移动应用开发技术】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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- T/GITIF 016-2025军贸产品技术服务资料编码要求
- T/DCB 027-2024电动汽车用蓄电池多因素耦合电性能 评价方法
- T/CACEM 54-2025“领跑者”评价技术要求 高速公路车辆救援服务
- 《熏蒸操作步骤》课件
- 《力知识点复习》课件
- 2026年电商部经理年度综合考核总结课件
- 《无线覆盖规划》课件
- 2026 年秋冬季流感预防:医疗机构流感防控预案课件
- 2026年陕西省北师大版高一语文第9课综合测试卷
- 2026 年秋冬季流感预防:秋冬运动提升免疫防流感课件
- 院前急救病历书写规范与质量评价标准
- 2026年秋季部编版九年级上册《道德与法治》主要知识点
- 2026年法考主观题案例分析答题模板
- 测绘工程院测绘外业生产安全工作手册(标准版)
- 2026年天津市中考英语试题(含答案)
- 2026年上半年落实全面从严主体责任情况报告
- 外国教育史发展脉络
- 聚丙烯(PP)原材料MSDS报告(PPH-T03牌号)
- 胸腔闭式引流护理团标
- DL-T 5210.1-2021 电力建设施工质量验收规程培训课件
- 四季的星空课件
评论
0/150
提交评论