MOGuildApplyView.m 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // MOGuildApplyView.m
  3. // MiMoLive
  4. //
  5. // Created by SuperC on 2023/10/25.
  6. //
  7. #import "MOGuildApplyView.h"
  8. @implementation MOGuildApplyView
  9. + (instancetype)moGuildApplyView{
  10. return [[[NSBundle mainBundle] loadNibNamed:@"MOGuildApplyView" owner:self options:nil] firstObject];
  11. }
  12. - (void)awakeFromNib{
  13. [super awakeFromNib];
  14. self.backgroundColor = [UIColor clearColor];
  15. self.contantView.layer.cornerRadius = 12.0;
  16. self.contantView.layer.masksToBounds = YES;
  17. NSArray *colorArr = @[[MOTools colorWithHexString:@"#FF62EE" alpha:1.0],[MOTools colorWithHexString:@"#9923FF" alpha:1.0]];
  18. UIImage *image = [MOTools createGradientRectImageWithBounds:CGRectMake(0, 0, (SCREENWIDTH - 36.0 * 2), 50.0) Colors:colorArr GradientType:0];
  19. [self.doneBtn setBackgroundImage:image forState:UIControlStateNormal];
  20. self.doneBtn.layer.cornerRadius = 48.0 / 2.0;
  21. self.doneBtn.layer.masksToBounds = YES;
  22. [self.titleBtn setTitle:NSLocalString(@"mimo_guild_recruitment_requirements") forState:UIControlStateNormal];
  23. self.firstTipLab.text = NSLocalString(@"mimo_guild_recruitment_requirements_content1");
  24. self.secondTipLab.text = NSLocalString(@"mimo_guild_recruitment_requirements_content2");
  25. [self.doneBtn setTitle:NSLocalString(@"mimo_guild_apply_to_settle_in_title") forState:UIControlStateNormal];
  26. self.thirdTipLab.text = NSLocalString(@"mimo_guild_applying_tips");
  27. }
  28. - (CGFloat)getViewHeight{
  29. CGFloat labWidth = SCREENWIDTH - 37.0 - 23.0;
  30. CGFloat firstLabHeight = [MOTools calculateRowHeight:self.firstTipLab.text fontSize:14.0 andWidth:labWidth];
  31. CGFloat secondLabHeight = [MOTools calculateRowHeight:self.secondTipLab.text fontSize:14.0 andWidth:labWidth];
  32. CGFloat height = 33.0 + 14.0 + firstLabHeight + 15.0 + secondLabHeight + 15.0 + 48.0 + 20.0;
  33. return height;
  34. }
  35. - (IBAction)doneBtnClick:(id)sender {
  36. self.doneBtnBlock ? self.doneBtnBlock() : nil;
  37. }
  38. @end