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;
左侧图片紧挨着左侧边框,距离不可调整,显得比较紧凑
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;
左侧图片紧挨着左侧边框,距离不可调整,显得比较紧凑
相关文章推荐
- easyui-tabs简单操作(随笔)
- iOS 7及以上,改变UIStatusBar颜色
- juery radio 选中/取消选中操作
- TestNG – Run multiple test classes (suite test)
- Number Sequence
- Do You Have Any Question for me
- 115. Distinct Subsequences (String; DP)
- Android UI的优化
- UIButton 的实现原理
- Android merge优化UI
- 理解UIImage 拉伸图片 resizableImageWithCapInsets
- UITextField,常见属性的罗列和用法
- 控制器:UITabBarController
- Qt Quick 图像处理实例之美图秀秀(附源码下载)
- 在android的spinner中,实现取VALUE值和TEXT值
- ueditor编辑器配置及使用介绍
- UI基础之 -------- 轮播图 UIScrollew UIPageControll NSTime
- String,StringBuffer和StringBuilder的区别
- HashMap 排序,按照 value,找出字符出现次数最多的
- LeetCode Unique Paths (简单DP)