JoshDSommer / nativescript-slides

A NativeScript plugin that is for Intro Tutorials, Image Carousels or any other slide functionality
Other
70 stars 32 forks source link

Nativescript-slides overlap content #112

Closed nikunjgajera closed 6 years ago

nikunjgajera commented 6 years ago

I am creating android native application. I am new in nativescript. I have requirement for create dynamic slide screen with many content in screen i created below code

slides.html

<Slides:SlideContainer angular="true" id="slides" #slides pageIndicators="true" changed="changeSlides">
    <Slides:Slide class="slide" *ngFor="let player of players">
        <Label [text]="player.name"></Label>
    </Slides:Slide> 
</Slides:SlideContainer>

slides.component.ts

import {registerElement} from "nativescript-angular/element-registry";
registerElement("Slide", () => require("nativescript-slides").Slide);
registerElement("SlideContainer", () => require("nativescript-slides").SlideContainer);

export class SlidesComponent implements OnInit {
    players : Array<Player> = [];
    @ViewChild("slides") slides: ElementRef;
    ngOnInit() {
        this.handlePlayer();
    }
    ngAfterViewInit() {
        let SlidesXml = this.slides.nativeElement;
        SlidesXml.constructView();
    }
    handlePlayer() {
        //Call api and get data
        this.players = data;
    }    
}

But when i execute tns run android I got below response(overlap all player name) selection_003 So how can i resolve this issues?

JoshDSommer commented 6 years ago

Hi @nikunjgajera this slide plugin is for regular NativeScript application not using angular. I would use https://github.com/TheOriginalJosh/nativescript-ngx-slides which was created specifically for angular use cases.

I'm going to close this issue. but if you have problems don't hesitate opening an issue up on the NGX slides repo.