当需要调用键盘时,有时会遮住输入框,我们一般都会将UITextField或UITextView向上移动,如下处理1 1 CGRect textFieldFrame = self.textField.frame;2 2 textFieldFrame.origin.y -=216;3 3 self......
分类:
其他好文 时间:
2015-09-22 23:14:45
阅读次数:
206
限制输入长度的问题,在这里完美的解决了!//先创建一个textField 和 一个button。12345678910111213141516171819202122232425262728293031323334353637383940414243#import "ViewController.h...
分类:
移动开发 时间:
2015-09-22 16:31:18
阅读次数:
158
#import "ViewController.h"@interface ViewController ()@property (weak, nonatomic) IBOutlet UITextField *nameTextField;@property (weak, nonatomic) IBOu...
分类:
其他好文 时间:
2015-09-22 16:23:48
阅读次数:
155
#import "RootViewController.h"@interface RootViewController ()@property (nonatomic, retain) UITextField *textField;@end@implementation RootViewControl...
分类:
移动开发 时间:
2015-09-18 18:29:03
阅读次数:
233
#import "TextViewController.h"@interface TextViewController ()@end@implementation TextViewController/* UITextView文本视图相比与UITextField直观的区别就是UITextView可以...
分类:
移动开发 时间:
2015-09-18 18:22:08
阅读次数:
325
UITextView跟UITextField很类似,不同的地方还是挺多的,例如没有placeholder,这个需要使用代理来进行设置,代码如下:首先要UITxtViewDelegate;代理方法:首先在创建时候 我们要设置TextView的属性:textView.textColor=[UIColor...
分类:
其他好文 时间:
2015-09-18 15:30:55
阅读次数:
127
通过attributedPlaceholder 属性来改变if([textField respondsToSelector:@selector(setAttributedPlaceholder:)]{UIColor*color =[UIColor blackColor];textField.attr...
分类:
其他好文 时间:
2015-09-18 15:11:06
阅读次数:
128
cocoa的NSNotification类封装了广播的消息,有兴趣接收信息的对象将利用Cocoa的NSNotificationCenter类的实例注册它们自己。注册的对象称为观察者。当匿名对象需要被动地观察和反应重要事件时,可以使用通知模式。与之相反,当匿名对象需要主动地影响所发生的事件时,可以使用...
分类:
其他好文 时间:
2015-09-18 15:08:37
阅读次数:
146
官方@protocol UITextFieldDelegate @optional- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField; // return NO to disallow editing.- (void...
分类:
其他好文 时间:
2015-09-18 13:30:43
阅读次数:
133
官方TextField@interface UITextField : UIControl @property(nonatomic,copy) NSString *text; // 文本 default is nil@...
分类:
移动开发 时间:
2015-09-18 10:26:17
阅读次数:
359