zoukankan      html  css  js  c++  java
  • asd

    - (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
  • 相关阅读:
    access生成sql脚本,通过VBA调用ADOX
    virtualbox 使用USB引导启动安装系统
    atom 调用g++编译cpp文件
    VPython 三维显示 —— hello word
    sql高级篇(一)
    sql基础篇
    struts2中的<s:select>默认选项
    关于SVN更新注意
    mysql中的substr()函数
    mysql中exists的用法介绍
  • 原文地址:https://www.cnblogs.com/dlwj/p/4975810.html
Copyright © 2011-2022 走看看