




下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
【移动应用开发技术】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年供货合同样式模板【副本】
- 2024-2025湘科版科学一年级下册第四单元试卷附答案
- 2025高中生物学教师课标考试测试卷及答案
- 2025商品类买卖合同范本
- 第18课《井冈翠竹》课件-2024-2025学年统编版语文七年级下册
- 公立医院成本核算指导手册
- MOOC 中医与辨证-暨南大学 中国大学慕课答案
- 耳聋与人工耳蜗植入术课件
- 三年级上册语文阅读同步扩展课件-第十五讲 童话寓言的阅读技巧(共14张PPT)-人教(部编版)
- 机油滤清器工作原理剖析
- 执行异议及复议课件
- 安全生产管理组织机构设置图
- 智能健身镜行业分析及案例
- 中联HIS系统挂号收费 操 作 说 明
- HIT(肝素诱导的血小板减少症)课件
评论
0/150
提交评论