nativescript-ngx-slides
nativescript-ngx-slides copied to clipboard
pageIndicators not showing
Thanks for the plugin, I can't get the pageIndicators to show.
I followed the readme:
Indicators
If the property pageIndicators is true you won't see the page indicators anymore as of 2.0.0 right away. there are two css classes exposed that you can setup however you like for active and inactive indicators. below is an example for semi translucent dots.
.slide-indicator-inactive{
background-color: #fff;
opacity : 0.4;
width : 10;
height : 10;
margin-left : 2.5;
margin-right : 2.5;
margin-top : 0;
border-radius : 5;
}
.slide-indicator-active{
background-color: #fff;
opacity : 0.9;
width : 10;
height : 10;
margin-left : 2.5;
margin-right : 2.5;
margin-top : 0;
border-radius : 5;
}
I simply copied and pasted those into my slide.component.css file (which holds other classes for the component).
The other classes do pick up, I have tried setting the page bg to white or dark colours, but I still can't see any dots.
slide.component.html
<GridLayout columns="*" rows="*, auto" class="slide-bg"> <StackLayout col="0" row="0"> <slides [loop]="false" [pageIndicators]="true" class="slide-bg"> <slide class="slide-1"> <Label text="Heading 1" class="slide-heading h1"></Label> <Image src="https://placeholdit.imgix.net/~text?txtsize=19&bg=ffffff&txt=200%C3%97200&w=200&h=200"></Image> </slide> <slide class="slide-2"> <Label text="Heading 2" class="slide-heading h1"></Label> <Image src="https://placeholdit.imgix.net/~text?txtsize=19&bg=ffffff&txt=200%C3%97200&w=200&h=200"></Image> </slide> <slide class="slide-3"> <Label text="Heading 3" class="slide-heading h1"></Label> <Image src="https://placeholdit.imgix.net/~text?txtsize=19&bg=ffffff&txt=200%C3%97200&w=200&h=200"></Image> </slide> </slides> </StackLayout> <StackLayout col="0" row="1"> <Button text="Get Started" class="submit-button h2" height="80" (tap)="goToLogin()"></Button> </StackLayout> </GridLayout>
I have tried with and without the gridlayout / button at the bottom of the page. I have also tried increasing the size of the pageIndicators and removing opacity without any luck.
Thoughts?
I'm having the same problem. Can't get them to show in any way.
Me too.
@TheOriginalJosh please let me know if you are able to fix this or advise what the problem might be.
If I set <slides [pageIndicators]="true">, i get the following error:
JS: clipToBounds with value false is not supported on Android. You can use this.android.getParent().setClipChildren(false) as an alternative.
Does anyone have any idea how to fixed this issue ?
Thanks in advance.
@smarza I'll fix this tonight.
@TheOriginalJosh Thanks. If there is anything I can help or contribute, please let me know.
@TheOriginalJosh was this fixed?
I am experiencing this problem on version 0.0.9.
I'm having the same problem. Can't get them to show in any way.
Same issue here!
I'll look into this tonight
@TheOriginalJosh any update on this issue
@Jaishankarb not yet, I haven't had much free time to dedicate to it unfortunately.
any update on this issue?
same problem here...
these should be working now for android and ios version 1.4. going to close this one. if you have any problems don't hesitate to open back up.
Sorry @TheOriginalJosh I've just updated to 0.1.4 and the indicators are still now showing, for both iOS and Android.
@carlosanjos page indicators are not on by default. You will need to make to set the property pageIndicators to true like this:
<slides loop="true" [pageIndicators]="true">
<slide class="slide-1">
<Label text="Slide 1" textWrap="true"></Label>
and then add styling for them in your app.css or component css.
background-color: #fff;
opacity : 0.4;
width : 10;
height : 10;
margin-left : 2.5;
margin-right : 2.5;
margin-top : 0;
border-radius : 5;
}
.slide-indicator-active{
background-color: #fff;
opacity : 0.9;
width : 10;
height : 10;
margin-left : 2.5;
margin-right : 2.5;
margin-top : 0;
border-radius : 5;
}
without both of these steps. page indicators won't display.
@TheOriginalJosh I'm using the following code and it doesn't work. Thanks for the fast reply.
<slides [loop]="false" [pageIndicators]="true" class="slide-bg">
<slide class="slide-1"><Label text="Heading 1" class="slide-heading h1"></Label>
<Image src="https://placeholdit.imgix.net/~text?txtsize=19&bg=ffffff&txt=200%C3%97200&w=200&h=200"></Image>
</slide>
<slide class="slide-2"><Label text="Heading 2" class="slide-heading h1"></Label>
<Image src="https://placeholdit.imgix.net/~text?txtsize=19&bg=ffffff&txt=200%C3%97200&w=200&h=200"></Image>
</slide>
<slide class="slide-3"><Label text="Heading 3" class="slide-heading h1"></Label>
<Image src="https://placeholdit.imgix.net/~text?txtsize=19&bg=ffffff&txt=200%C3%97200&w=200&h=200"></Image>
</slide>
</slides>
.slide-1{
background-color: darkslateblue;
}
.slide-2{
background-color: darkcyan;
}
.slide-3{
background-color: darkgreen;
}
Label{
text-align: center;
width: 100%;
font-size: 35;
margin-top: 35;
color: red;
}
.slide-indicator-inactive{
background-color: #fff;
opacity : 0.4;
width : 10;
height : 10;
margin-left : 2.5;
margin-right : 2.5;
margin-top : 0;
border-radius : 5;
}
.slide-indicator-active{
background-color: #fff;
opacity : 0.9;
width : 10;
height : 10;
margin-left : 2.5;
margin-right : 2.5;
margin-top : 0;
border-radius : 5;
}

@carlosanjos I just tested your code on an android emulator and I'm seeing the background color and the slide indicators. I'm not on a mac at the moment so I can't test on an ios emulator. but it seems that the background colors are not showing up correctly for you. maybe try changing them to a hexadecimal color like #000?

Doesn't show for me either. I have image as the component's background, might that be a problem?
@dobjek it very well could be the image. that is something I haven't really thought of . if you put the default code in from the README do the indicators show up?
I just started the demo project, added the styles to the app.css but no indicators showing up. (set the property to true of course). Running on iOS.
@sittingbool make sure you set the pageIndicators property to true in the slides component
<slides [pageIndicators]="true" class="slide-bg">
@sittingbool alternatively it could be an issue with the slides being generated in a ngFor loop in the demo project. you may want to try have the slides statically defined and see if that works.
I had this property on true, I also had a colored background. But still not showing. Also I tried doing the slides manually, because that would be my use case. Didn't work. If I find the time I will work on this and give you a pull request. Tell me if you find the time to have a look.
@sittingbool What version of NativeScript and Angular are you running?
The latest NativeScript (3.0.3) and Angular like in the package.json of the demo App. I used the demo App provided by this repository. I downloaded as a zip, changed the absolute path to the slides-project into a relative path, added [pageIndicators]="true", the css like in the readme and ran it with tns run ios. No indicators visible. Then I added background-color but still: no indicators visible.
@sittingbool one thing you may want to try doing is setting the margin-top property to a lower or negative number. the positioning top seems to be inconsistent and I'm going to need to work on it.
i believe this is why we are not seeing those pageIndicators: https://github.com/NativeScript/nativescript-angular/issues/769