2018-01-25-低级错误

2018/1/25 posted in  工作总结

在 ContenView 上添加 button 不显示

    self.collectBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.collectBtn.frame = CGRectMake(screen_width-(screen_width-40), CGRectGetMaxY(_videoImage.frame)+left, 40, 40);
//    self.collectBtn.backgroundColor = [UIColor redColor];
    [self.collectBtn setBackgroundImage:[UIImage imageNamed:@"star-highlighted"] forState:UIControlStateNormal];
    [self.collectBtn setBackgroundImage:[UIImage imageNamed:@"star-highlighted-template"] forState:UIControlStateHighlighted];
    [self.collectBtn addTarget:self action:@selector(collectBtnClick) forControlEvents:UIControlEventTouchUpInside];
    
    [self.contentView addSubview:self.collectBtn];

这里的美工给的图片不是我之前的公司的美工,他们的命名方式很奇怪

  • 默认的格式:star-template
  • 高亮的格式:star-highlighted-template

一般的美工都是这么明名的

  • 默认的格式:star-template
  • 高亮的格式:star-template-highlighted

再加上我最近状态不佳,就直接写成以上的样子,最后什么都没显示

总结:不管是在哪上班摸清楚他们的行为方式