HomeMusicPageView.m 960 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // HomeMusicPageView.m
  3. // KulexiuForTeacher
  4. //
  5. // Created by 王智 on 2024/12/26.
  6. //
  7. #import "HomeMusicPageView.h"
  8. @interface HomeMusicPageView ()
  9. @property (nonatomic, copy) HomeMusicPageViewCallback callback;
  10. @end
  11. @implementation HomeMusicPageView
  12. + (instancetype)sharedInstance {
  13. HomeMusicPageView *view = [[[NSBundle mainBundle] loadNibNamed:@"HomeMusicPageView" owner:nil options:nil] firstObject];
  14. return view;
  15. }
  16. - (void)pageActionCallback:(HomeMusicPageViewCallback)callback {
  17. if (callback) {
  18. self.callback = callback;
  19. }
  20. }
  21. + (CGFloat)getViewHeight {
  22. CGFloat imageWidth = (KPortraitWidth - 14 * 2 - 12 * 2 - 10 * 2) / 3.0f;
  23. CGFloat imageHeight = imageWidth / 101.0f * 92.0f;
  24. return 80 + imageHeight;
  25. }
  26. /*
  27. // Only override drawRect: if you perform custom drawing.
  28. // An empty implementation adversely affects performance during animation.
  29. - (void)drawRect:(CGRect)rect {
  30. // Drawing code
  31. }
  32. */
  33. @end