优化提交
This commit is contained in:
@@ -18,6 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXGiftScrollView : UIView
|
||||
@property (nonatomic,strong)QXGiftScrollModel *model;
|
||||
@property (nonatomic,strong)NSArray<QXGiftScrollModel *>* list;
|
||||
@property (nonatomic,weak)id<QXGiftScrollViewDelegate>delegate;
|
||||
@end
|
||||
|
||||
|
||||
@@ -46,6 +46,27 @@ static NSInteger maxCount = 5;
|
||||
}
|
||||
self.cycleScrollView.imageURLStringsGroup = self.titles;
|
||||
}
|
||||
-(void)setList:(NSArray<QXGiftScrollModel *> *)list{
|
||||
_list = list;
|
||||
if (list.count >= 5) {
|
||||
[self.dataArray removeAllObjects];
|
||||
[self.titles removeAllObjects];
|
||||
for (int i = 0; i < 5; i++) {
|
||||
QXGiftScrollModel*md = list[i];
|
||||
[self.dataArray addObject:md];
|
||||
[self.titles addObject:md.fromUserName];
|
||||
}
|
||||
}else{
|
||||
for (QXGiftScrollModel*md in list) {
|
||||
[self.dataArray removeLastObject];
|
||||
[self.titles removeLastObject];
|
||||
[self.dataArray insertObject:md atIndex:0];
|
||||
[self.titles insertObject:md.fromUserName atIndex:0];
|
||||
|
||||
}
|
||||
}
|
||||
self.cycleScrollView.imageURLStringsGroup = self.titles;
|
||||
}
|
||||
- (Class)customCollectionViewCellClassForCycleScrollView:(SDCycleScrollView *)view{
|
||||
return [QXGiftScrollViewCell class];
|
||||
}
|
||||
|
||||
@@ -8,13 +8,14 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXRoomListModel.h"
|
||||
#import "QXSearchModel.h"
|
||||
#import "MarqueeLabel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXHomeRoomCell : UICollectionViewCell
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *coverImageView;
|
||||
@property (weak, nonatomic) IBOutlet UIView *displayMaskView;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *IDLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
|
||||
@property (weak, nonatomic) IBOutlet MarqueeLabel *nameLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *countLabel;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *roomTypeView;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *animateImageView;
|
||||
@@ -23,6 +24,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@property (strong, nonatomic) QXSearchModel *searchModel;
|
||||
@property (assign, nonatomic) BOOL isAppStore;
|
||||
|
||||
-(void)startAnimating;
|
||||
-(void)endAnimating;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -28,10 +28,15 @@
|
||||
// self.roomTypeView.image = [UIImage imageNamed:@"Group 7156"];
|
||||
// }
|
||||
[self.roomTypeView sd_setImageWithURL:[NSURL URLWithString:model.label_icon]];
|
||||
self.animateImageView.animationDuration = 1;
|
||||
self.animateImageView.animationImages = self.imgs;
|
||||
|
||||
|
||||
}
|
||||
-(void)startAnimating{
|
||||
[self.animateImageView startAnimating];
|
||||
}
|
||||
-(void)endAnimating{
|
||||
[self.animateImageView stopAnimating];
|
||||
}
|
||||
-(void)setHistoryModel:(QXMyRoomHistory *)historyModel{
|
||||
_historyModel = historyModel;
|
||||
[self.coverImageView sd_setImageWithURL:[NSURL URLWithString:historyModel.room_cover]];
|
||||
@@ -90,6 +95,8 @@
|
||||
}else{
|
||||
[self.displayMaskView setTopToBottomGradientBackgroundWithColors:@[[UIColor colorWithHexString:@"#00000000"],[UIColor colorWithHexString:@"#00000096"]] frame:CGRectMake(0, 0, (SCREEN_WIDTH-15*3-1)/2.0, (SCREEN_WIDTH-15*3-1)/2.0)];
|
||||
}
|
||||
self.animateImageView.animationDuration = 1;
|
||||
self.animateImageView.animationImages = self.imgs;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -109,11 +109,19 @@
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="V8F-du-Rah">
|
||||
<rect key="frame" x="8" y="258" width="31" height="14.333333333333314"/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="张三李四王" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="V8F-du-Rah" customClass="MarqueeLabel">
|
||||
<rect key="frame" x="8" y="258" width="65" height="14.333333333333314"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="65" id="4bC-3c-1jm"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="marqueeType">
|
||||
<integer key="value" value="0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
</subviews>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user