UITextField 设置字体垂直居中

[cpp]  view plain copy
  1. textField.textAlignment = UITextAlignmentLeft; //水平左对齐  
  2. textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;  //垂直居中  

运行效果如下:

你可能感兴趣的:(UITextField 设置字体垂直居中)