通用h5飘屏优化
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#import "SVGA.h"
|
||||
#import "XPRoomTarrowBannerView.h"
|
||||
#import "XPSVGAPlayer.h"
|
||||
#import "MarqueeLabel.h"
|
||||
|
||||
@interface XPRoomTarrowBannerView()<SVGAPlayerDelegate>
|
||||
///动画管理类
|
||||
@property (strong, nonatomic) SVGAParser *parser;
|
||||
@@ -38,8 +38,6 @@
|
||||
[self addSubview:self.bgImageView];
|
||||
[self addSubview:self.giftImageView];
|
||||
[self addSubview:self.titleView];
|
||||
self.titleView.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular];
|
||||
self.titleView.textColor = [UIColor whiteColor];
|
||||
self.bgImageView.image = kImage(@"room_tarrow_banner_h5_bg");
|
||||
self.titleView.fadeLength = 50.0f;
|
||||
|
||||
@@ -52,11 +50,11 @@
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(kGetScaleWidth(54.5));
|
||||
make.leading.mas_equalTo(kGetScaleWidth(28));
|
||||
make.trailing.mas_equalTo(-kGetScaleWidth(28.5));
|
||||
make.height.mas_equalTo(kGetScaleWidth(12));
|
||||
make.centerY.equalTo(self);
|
||||
}];
|
||||
self.titleView.backgroundColor = [UIColor redColor];
|
||||
}
|
||||
-(void)installUI{
|
||||
[self addSubview:self.bgImageView];
|
||||
@@ -75,6 +73,7 @@
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(kGetScaleWidth(54.5));
|
||||
make.trailing.mas_equalTo(-kGetScaleWidth(29.5));
|
||||
make.height.mas_equalTo(kGetScaleWidth(12));
|
||||
make.centerY.equalTo(self);
|
||||
}];
|
||||
}
|
||||
@@ -88,7 +87,7 @@
|
||||
[self.parser parseWithNamed:@"pi_room_tarrow_h5_banner" inBundle:nil completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
self.giftImageView.hidden = NO;
|
||||
self.giftImageView.videoItem = videoItem;
|
||||
self.giftImageView.loops = 1;
|
||||
self.giftImageView.loops = 3;
|
||||
self.giftImageView.clearsAfterStop = NO;
|
||||
[self.giftImageView startAnimation];
|
||||
} failureBlock:^(NSError * _Nonnull error) {
|
||||
@@ -148,10 +147,10 @@
|
||||
}
|
||||
- (MarqueeLabel *)titleView{
|
||||
if(!_titleView){
|
||||
_titleView = [MarqueeLabel new];
|
||||
_titleView = [[MarqueeLabel alloc] init];
|
||||
_titleView.scrollDuration = 5.0;
|
||||
_titleView.fadeLength = 6.0f;
|
||||
_titleView.scrollDuration = 6.0;
|
||||
_titleView.fadeLength = 8.0f;
|
||||
_titleView.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _titleView;
|
||||
}
|
||||
|
Reference in New Issue
Block a user