JoshDSommer / nativescript-ngx-slides

A NativeScript + Angular module for to add a slides component to your mobile app
Other
45 stars 34 forks source link

Default width does not consider padding/margin of parent view #22

Open heese opened 7 years ago

heese commented 7 years ago

When computing the width of the slides it does not consider the width of the layout containing the tag <slides> , e.g., padding or margin. A workaround is to set the slide width explicitly (thanks for providing this attribute) but it would be more convenient if this could be done automatically.

Unfortunately, I haven't found a way to get the width of the parent layout yet. I hope that you just know how to deal with it :-)

The following example demonstrates the effect:

<StackLayout style="padding:40">
    <Label text="Slide 1" textWrap="true" textAlignment="center"></Label>

    <slides loop="true" pageIndicators="true">
        <slide class="slide slide-1">
            <Label text="Slide 1" textWrap="true" textAlignment="center"></Label>
        </slide>
    </slides>
</StackLayout>
sfaessler commented 6 years ago

Any news here? Seems like I'm having the same problem.

tskweres commented 5 years ago

same

michaelfidelis commented 5 years ago

Any solution/workaround?