文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>UITextField的使用总结

UITextField的使用总结

时间:2010-10-05  来源:KidReborn

1.UITextField的初始化和设置

   textField = [[UITextField alloc] initWithFrame:CGRectMake(120.0f, 80.0f, 150.0f, 30.0f)];
        [textField setBorderStyle:UITextBorderStyleRoundedRect]; //外框类型
        textField.placeholder = @"password"; //默认显示的字
        textField.secureTextEntry = YES; //密码
        textField.autocorrectionType = UITextAutocorrectionTypeNo;
        textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
        textField.returnKeyType = UIReturnKeyDone;
        textField.clearButtonMode = UITextFieldViewModeWhileEditing; //编辑时会出现个修改X
        textField.delegate = self;

2.要实现的Delegate方法,关闭键盘

- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
        [self.textField resignFirstResponder];
        return YES;
}
相关阅读 更多 +
排行榜 更多 +
弓箭手战士酷跑

弓箭手战士酷跑

飞行射击 下载
三角洲行动全面战场攀升A点进攻指南

三角洲行动全面战场攀升A点进攻指南

飞行射击 下载
僵尸射手世界大战

僵尸射手世界大战

飞行射击 下载