您的位置:首页 > 产品设计 > UI/UE

uitextfield 左侧图片

2015-10-30 09:54 459 查看
UITextField *tf1=[[UITextField
alloc]initWithFrame:CGRectMake(10,
100,
200, 50)];

tf1.borderStyle=UITextBorderStyleRoundedRect;

tf1.backgroundColor=[UIColor
whiteColor];
[self.view
addSubview:tf1];

UIImageView *image=[[UIImageView
alloc]initWithImage:[UIImage
imageNamed:@"age_img"]];

// image.frame=CGRectMake(20, 0, 20, 20);
tf1.leftView=image;

tf1.leftView.backgroundColor=[UIColor
orangeColor];

tf1.leftViewMode=UITextFieldViewModeAlways;



左侧图片紧挨着左侧边框,距离不可调整,显得比较紧凑
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: