npm i --save nativescript-xz-ad-generation
- 版本: 1.0.26
- GitHub:
- NPM: https://npmjs.net.cn/package/nativescript-xz-ad-generation
- 下载量
- 昨日: 0
- 上周: 2
- 上月: 25
NativeScript 广告生成插件
安装
tns plugin add nativescript-xz-ad-generation
使用
导入模块
@NgModule({
imports: [
NativeScriptCommonModule,
HomeRoutingModule,
XzAdGenerationModule, // <-- Add this!
],
declarations: [
HomeComponent
],
schemas: [
NO_ERRORS_SCHEMA
]
})
export class HomeModule { }
横幅广告
<XzAdGBanner locationId="48547" bannerWidth="320" bannerHeight="50"></XzAdGBanner>
原生广告
<XzAdGLayout locationId="48635"> <!-- Use 48636 for Android -->
<ng-template let-ad>
<GridLayout class="ad-container" columns="100 *" rows="auto">
<GridLayout rows="auto" col="0">
<Image src="{{ ad.iconImageUrl ? ad.iconImageUrl : ad.mainImageUrl }}" width="100" height="100"></Image>
<XzAdGInformationIconView *ngIf="ad.nativeAd" [nativeAd]="ad.nativeAd" verticalAlignment="top" horizontalAlignment="left"></XzAdGInformationIconView>
</GridLayout>
<StackLayout col="1">
<Label [text]="ad.title" textWrap="true"></Label>
<Label [text]="ad.sponsor" class="sponsor-name"></Label>
</StackLayout>
</GridLayout>
</ng-template>
</XzAdGLayout>
演示
查看 demo-angular
npm run setup
# ios
npm run demo.ng.ios
# android
npm run demo.ng.android
对于提交者
构建 & 发布
cd publish
./pack.sh # For build
./publish.sh # For build & publish
许可证
Apache 许可证版本 2.0,2004 年 1 月