| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- //
- // ArrangeRecentRankButtonView.m
- // KulexiuForStudent
- //
- // Created by 王智 on 2024/11/19.
- //
- #import "ArrangeRecentRankButtonView.h"
- @interface ArrangeRecentRankButtonView ()
- @property (weak, nonatomic) IBOutlet UIView *bgView;
- @property (weak, nonatomic) IBOutlet UILabel *titleLabel;
- @property (nonatomic, copy) RankRecentCallback callback;
- @end
- @implementation ArrangeRecentRankButtonView
- + (instancetype)sharedInstance {
- ArrangeRecentRankButtonView *view = [[[NSBundle mainBundle] loadNibNamed:@"ArrangeRecentRankButtonView" owner:nil options:nil] firstObject];
- return view;
- }
- - (void)settingCallback:(RankRecentCallback)callback {
- if (callback) {
- self.callback = callback;
- }
- }
- - (IBAction)butonAction:(id)sender {
- self.isChoose = !self.isChoose;
- if (self.callback) {
- self.callback(self.isChoose);
- }
- }
- - (void)setIsChoose:(BOOL)isChoose {
- _isChoose = isChoose;
- if (isChoose) {
- self.bgView.backgroundColor = HexRGB(0xE8FFFB);
- self.bgView.layer.borderColor = THEMECOLOR.CGColor;
- self.titleLabel.textColor = HexRGB(0x18B99A);
- self.titleLabel.font = [UIFont systemFontOfSize:12.0f weight:UIFontWeightMedium];
- }
- else {
- self.bgView.backgroundColor = HexRGB(0xffffff);
- self.bgView.layer.borderColor = [UIColor clearColor].CGColor;
- self.titleLabel.textColor = HexRGB(0x333333);
- self.titleLabel.font = [UIFont systemFontOfSize:12.0f weight:UIFontWeightRegular];
- }
- }
- + (CGFloat)getViewHeight {
- return 28.0f;
- }
- /*
- // Only override drawRect: if you perform custom drawing.
- // An empty implementation adversely affects performance during animation.
- - (void)drawRect:(CGRect)rect {
- // Drawing code
- }
- */
- @end
|