-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3efd64d
commit a8c94a7
Showing
5 changed files
with
115 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
## 0.0.6 | ||
* fix bug | ||
|
||
## 0.0.5 | ||
|
||
* 支持iOS ATT权限获取、开屏广告、插屏广告 、横幅广告、模板广告、模板视频信息流 、全屏视频、 信息流广告、激励视频广告 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// QBUnifiedNativeImageView.h | ||
// MYSDKDemo | ||
// | ||
// Created by 凌锋晨 on 2021/4/26. | ||
// | ||
|
||
#import "GDTUnifiedNativeAdView.h" | ||
#import "MYAdCenter.h" | ||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface QBUnifiedNativeImageView : GDTUnifiedNativeAdView | ||
@property (nonatomic, strong) UILabel *descLabel; | ||
@property (nonatomic, strong) UIImageView *imageView; | ||
//初始化接口 | ||
- (instancetype)initWithFrame:(CGRect)frame; | ||
|
||
/// 赋值接口 | ||
/// @param unifiedNativeDataObject 广告数据 | ||
/// @param center 用于调用my_registerDataObject,绑定点击页面 | ||
/// @param rootViewController 点击之后跳转时需要一个锚点viewcontroller | ||
//- (void)setupWithUnifiedNativeAdObject:(GDTUnifiedNativeAdDataObject *)unifiedNativeDataObject center:(QUBIADSdkCenter*)center rootViewController:(UIViewController *)rootViewController; | ||
- (void)setupWithUnifiedNativeAdObject:(GDTUnifiedNativeAdDataObject *)unifiedNativeDataObject center:(MYAdCenter*)center rootViewController:(UIViewController *)rootViewController; | ||
|
||
//计算广告高度接口 | ||
+(CGFloat)getViewHeightWithWidth:(CGFloat)width; | ||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// | ||
// QBUnifiedNativeImageView.m | ||
// MYSDKDemo | ||
// | ||
// Created by 凌锋晨 on 2021/4/26. | ||
// | ||
|
||
#import "QBUnifiedNativeImageView.h" | ||
|
||
#define descLabelHeight 30 | ||
#define descLabel_to_imageView 7 | ||
|
||
@implementation QBUnifiedNativeImageView | ||
|
||
- (instancetype)initWithFrame:(CGRect)frame | ||
{ | ||
self = [super initWithFrame:frame]; | ||
if (self) { | ||
self.logoView.hidden = YES; | ||
[self addSubview:self.descLabel]; | ||
[self addSubview:self.imageView]; | ||
self.backgroundColor = [UIColor whiteColor]; | ||
self.descLabel.frame = CGRectMake(0, 0, frame.size.width, descLabelHeight); | ||
self.imageView.frame = CGRectMake(0, (descLabelHeight+descLabel_to_imageView), frame.size.width, frame.size.width * 9.0 / 16.0); | ||
} | ||
return self; | ||
} | ||
|
||
//- (void)setupWithUnifiedNativeAdObject:(GDTUnifiedNativeAdDataObject *)unifiedNativeDataObject center:(QUBIADSdkCenter*)center rootViewController:(UIViewController *)rootViewController | ||
- (void)setupWithUnifiedNativeAdObject:(GDTUnifiedNativeAdDataObject *)unifiedNativeDataObject center:(MYAdCenter*)center rootViewController:(UIViewController *)rootViewController | ||
{ | ||
//设置锚点controller | ||
self.viewController = rootViewController; | ||
|
||
//赋值 | ||
self.descLabel.text = unifiedNativeDataObject.desc; | ||
[unifiedNativeDataObject bindImageViews:@[self.imageView] placeholder:nil]; | ||
//绑定点击响应view | ||
[center my_registerDataObject:unifiedNativeDataObject view:self clickableViews:@[self.imageView] customClickableViews:@[]]; | ||
} | ||
|
||
+(CGFloat)getViewHeightWithWidth:(CGFloat)width | ||
{ | ||
//图片宽高比为16:9 | ||
CGFloat viewHeight = width * 9.0 / 16.0; | ||
|
||
//descLabel 高度为30 | ||
CGFloat descLabelHeight1 = descLabelHeight; | ||
|
||
//descLabel 距离imageView 10; | ||
|
||
CGFloat descLabel_to_imageView1 = descLabel_to_imageView; | ||
|
||
//整个view的高度为 | ||
return (viewHeight+descLabelHeight1+descLabel_to_imageView1); | ||
|
||
|
||
} | ||
|
||
#pragma mark - proerty getter | ||
|
||
- (UIImageView *)imageView | ||
{ | ||
if (!_imageView) { | ||
_imageView = [[UIImageView alloc] init]; | ||
} | ||
return _imageView; | ||
} | ||
|
||
- (UILabel *)descLabel | ||
{ | ||
if (!_descLabel) { | ||
_descLabel = [[UILabel alloc] init]; | ||
} | ||
return _descLabel; | ||
} | ||
|
||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters