bottomButton.m 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // bottomButton.m
  3. // BuguLive
  4. //
  5. // Created by yy on 16/7/6.
  6. // Copyright © 2016年 xfg. All rights reserved.
  7. //
  8. #import "bottomButton.h"
  9. @implementation bottomButton
  10. - (instancetype)initWithFrame:(CGRect)frame bothLabelHeight:(CGFloat)height imgName:(NSString *)imgName
  11. {
  12. if (self = [super initWithFrame:frame]) {
  13. self.leftLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenW *0.0312, (frame.size.height-height)/2, frame.size.width/3, height)];
  14. self.rightLabel = [[UILabel alloc]initWithFrame:CGRectMake(frame.size.width/2, (frame.size.height-height)/2, frame.size.width/2-kScreenW *0.0625, height)];
  15. self.leftLabel.textAlignment = NSTextAlignmentLeft;
  16. self.rightLabel.textAlignment =NSTextAlignmentRight;
  17. self.rightImage = [[UIImageView alloc]initWithFrame:CGRectMake(frame.size.width-kScreenW *0.0468, (frame.size.height-kScreenH *0.0088)/2-kScreenH *0.003, kScreenW *0.0218, kScreenH *0.0176)];
  18. self.rightImage.image =[UIImage imageNamed:imgName];
  19. [self addSubview:self.leftLabel];
  20. [self addSubview:self.rightLabel];
  21. [self addSubview:self.rightImage];
  22. }
  23. return self;
  24. }
  25. @end