2013-10-04 103 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)];