UITextFiled 总结


代理


输入栏垂直居中

  textField.contentVerticalAlignment=UIControlContentVerticalAlignmentCenter;



左边的view

  UITextField *textField=[[UITextField alloc]initWithFrame:CGRectMake(100, 200, 200, 30)];

    textField.contentVerticalAlignment=UIControlContentVerticalAlignmentCenter;

    UILabel *leftLabel=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 60, 30)];

    leftLabel.font=[UIFont systemFontOfSize:13.0];
    leftLabel.text=@"提现金额";
    textField.leftView=leftLabel;
    textField.leftViewMode=UITextFieldViewModeAlways;

    textField.placeholder=@"请输入";

    [self.view addSubview:textField];



参考资料:

UITextField垂直居中对齐

http://blog.sina.com.cn/s/blog_74bf41030100ymd4.html




你可能感兴趣的:(UITextFiled 总结)