博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
asd
阅读量:7155 次
发布时间:2019-06-29

本文共 1281 字,大约阅读时间需要 4 分钟。

- (id)initWithFrame:(CGRect)frame{    self = [super initWithFrame:frame];    if (self) {        // Initialization code        self.tintColor = [UIColor whiteColor];    }    return self;}-(void) layoutSubviews{        UITextField *searchField;  NSUInteger numViews = [self.subviews count];  for(int i = 0; i < numViews; i++) {    if([[self.subviews objectAtIndex:i] isKindOfClass:[UITextField class]]) { //conform?      searchField = [self.subviews objectAtIndex:i];    }  }  if(!(searchField == nil)) {        searchField.placeholder = @"输入要查找的艺人的名字";        [searchField setBorderStyle:UITextBorderStyleRoundedRect];        [searchField setBackgroundColor:[UIColor whiteColor]];        //自己的搜索图标        NSString *path = [[NSBundle mainBundle] pathForResource:@"GUI_search" ofType:@"png"];        UIImage *image = [UIImage imageWithContentsOfFile:path];    UIImageView *iView = [[UIImageView alloc] initWithImage:image];        [iView setFrame:CGRectMake(0.0, 0.0, 30.0, 30.0)];    searchField.leftView = iView;  }      [super layoutSubviews];}/*// Only override drawRect: if you perform custom drawing.// An empty implementation adversely affects performance during animation.- (void)drawRect:(CGRect)rect{    // Drawing code}*/@end

 

转载于:https://www.cnblogs.com/dlwj/p/4975810.html

你可能感兴趣的文章
线程4 同步和死锁
查看>>
详谈如何定制自己的博客园皮肤
查看>>
【CF】328 D. Super M
查看>>
HDU1517 A Multiplication Game
查看>>
js装饰者模式
查看>>
ThinkPHP中的函数库载入
查看>>
guava
查看>>
组合数据类型练习,综合练习
查看>>
Nodejs Guides(二)
查看>>
hdu 4286 Data Handler
查看>>
iOS-可变参数va_list、va_start、va_arg、va_end、NS_FORMAT_FUNCTION(1, 2)
查看>>
EL表达式
查看>>
项目PMO工作
查看>>
【Android】资源系列(一) -- 国际化(多语言)
查看>>
浏览器对文字的解析
查看>>
Reuse Is About People and Education, Not Just Architecture
查看>>
【5.20 专辑】来聊聊程序猿的那些花式表白
查看>>
Damn Couples ZOJ - 3161
查看>>
Linux内存使用情况以及内存泄露情况
查看>>
QuickReport让安装的所有打印机同时打印(多台打印)
查看>>