2013-10-04 104 views
3

我必须设置我已经分配给leftview的图像帧。 看到我的代码。如何在ios的uitextfield的左侧添加左侧边距?

UIImageView *imageView = [[UIImageView alloc] init]; 

imageView.frame = CGRectMake(0,0 ,15, userNameTextField.frame.size.height); 

userNameTextField.leftViewMode = UITextFieldViewModeAlways; 
userNameTextField.leftView = imageView; 

回答

-1

页边距作为内容插页在iOS UIKit中实现。以下代码将在文本视图的左侧产生5个像素边距

[atextView setTextContainerInset:UIEdgeInsetsMake(0, 5, 0, 0)];