付费下载
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
【移动应用开发技术】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高二英语期末模拟卷01(考试版A4)(人教版)含答案
- 2026福建浦盛产业发展集团有限公司浦城县浦恒供应链有限公司职业经理人招聘备考考试题库附答案解析
- 2026贵州省省、市两级机关遴选公务员357人备考考试试题附答案解析
- 2026浦发银行成都分行支行筹备中心社会招聘参考考试试题附答案解析
- 2026年中国科学院合肥肿瘤医院血液透析中心医护人员招聘7名备考考试试题附答案解析
- 2026广东湛江市吴川市公安局招聘警务辅助人员32人(第一次)参考考试题库附答案解析
- 2026年中国科学院合肥肿瘤医院血液透析中心医护人员招聘7名参考考试试题附答案解析
- 2026华南理工大学电力学院科研助理招聘备考考试试题附答案解析
- 富士康工厂设备管理制度
- JG/T 382-2012传递窗
- 基于深度学习的高精度镗床参数优化-洞察阐释
- 供应商评估准入、管理制度
- 深圳市科学中学2023-2024学年高一(上)期末物理试卷
- 中国地理:中国地理空间定位(课件)
- 10kV小区供配电设计、采购、施工EPC投标技术方案技术标
- 新人教版七年级上册初中数学全册教材习题课件
- 2024-2025学年湖北省咸宁市高二生物学上册期末达标检测试卷及答案
- JTG F40-2004 公路沥青路面施工技术规范
- 三片饮料罐培训
评论
0/150
提交评论