dujiahong
- (UIButton *)navSearBtn
{
    if (!_navSearBtn) {
        _navSearBtn = [[UIButton alloc]init];
        _navSearBtn.backgroundColor = [UIColor clearColor];
        _navSearBtn.titleLabel.font = DEF_FontSize_14;
        [_navSearBtn setTitle:@"请输入关键词搜索" forState:UIControlStateNormal];
        [_navSearBtn setImage:[UIImage imageNamed:@"搜索"] forState:UIControlStateNormal];
        [_navSearBtn setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, -330 / WIDTH_6S_SCALE)];
        //按钮中文字靠最左边
//        _navSearBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
        //根据需求调整按钮中文字位置
        [_navSearBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, -120 / WIDTH_6S_SCALE, 0, 0)];
        _navSearBtn.layer.borderColor = [UIColor whiteColor].CGColor;
        _navSearBtn.layer.borderWidth = 1;
        [_navSearBtn addTarget:self action:@selector(navSearBtnAction:) forControlEvents:UIControlEventTouchUpInside];
        _navSearBtn.layer.cornerRadius = 5 / HEIGHT_6S_SCALE;
        _navSearBtn.layer.masksToBounds = YES;
    }
    return _navSearBtn;
}

 

分类:

技术点:

相关文章:

  • 2021-08-30
  • 2021-08-01
  • 2021-12-08
  • 2021-09-21
  • 2021-10-10
  • 2022-01-20
  • 2021-12-04
  • 2021-10-16
猜你喜欢
  • 2021-05-30
  • 2021-10-08
  • 2021-11-23
  • 2022-02-04
  • 2021-12-04
  • 2021-08-17
  • 2021-09-23
相关资源
相似解决方案