UIAlertVIEw *alertVIEw=[[UIAlertVIEw alloc]initWithTitle:@"Save" message:@"Please Enter the name of pdf" delegate:self cancelbuttonTitle:@"Cancel" otherbuttonTitles:@"OK",nil];[alertVIEw setAlertVIEwStyle:UIAlertVIEwStylePlainTextinput]
当UITextFIEld为空时,我想做什么我用代理功能禁用OK按钮
- (BOol)alertVIEwShouldEnableFirstOtherbutton:(UIAlertVIEw *)alertVIEw{return NO;}
当用户开始在文本框中写入某些东西时,OK按钮应该被启用.
解决方法 请尝试这个- (BOol)alertVIEwShouldEnableFirstOtherbutton:(UIAlertVIEw *)alertVIEw { /* RetrIEve a text fIEld at an index - raises NSRangeException when textFIEldindex is out-of-bounds. The fIEld at index 0 will be the first text fIEld (the single fIEld or the login fIEld),The fIEld at index 1 will be the password fIEld. */ /* 1> Get the Text FIEld in alertvIEw 2> Get the text of that Text FIEld 3> Verify that text length 4> return YES or NO Based on the length */ return [alertVIEw textFIEldAtIndex:0].text.length > 0; }总结
以上是内存溢出为你收集整理的ios – 禁用UIAlertView按钮全部内容,希望文章能够帮你解决ios – 禁用UIAlertView按钮所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)