1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- //
- // HomeMusicPageView.m
- // KulexiuForTeacher
- //
- // Created by 王智 on 2024/12/26.
- //
- #import "HomeMusicPageView.h"
- @interface HomeMusicPageView ()
- @property (nonatomic, copy) HomeMusicPageViewCallback callback;
- @end
- @implementation HomeMusicPageView
- + (instancetype)sharedInstance {
- HomeMusicPageView *view = [[[NSBundle mainBundle] loadNibNamed:@"HomeMusicPageView" owner:nil options:nil] firstObject];
- return view;
- }
- - (void)pageActionCallback:(HomeMusicPageViewCallback)callback {
- if (callback) {
- self.callback = callback;
- }
- }
- + (CGFloat)getViewHeight {
- CGFloat imageWidth = (KPortraitWidth - 14 * 2 - 12 * 2 - 10 * 2) / 3.0f;
- CGFloat imageHeight = imageWidth / 101.0f * 92.0f;
- return 80 + imageHeight;
- }
- /*
- // Only override drawRect: if you perform custom drawing.
- // An empty implementation adversely affects performance during animation.
- - (void)drawRect:(CGRect)rect {
- // Drawing code
- }
- */
- @end
|