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

Label textWrap not working in Slide #52

Open burkeholland opened 8 years ago

burkeholland commented 8 years ago

Great plugin! Had no issues getting this setup and working with Angular 2.

Currently, it doesn't seem like textWrap works for Labels that are placed in slides.

Steps to reproduce...

Use the following markup...

<StackLayout>
    <SlideContainer angular="true" #slides>
        <Slide>
            <Label textWrap="true" class="p" text="this is a test of some static long text to see whether or not the wrapping actually works"></Label>                            
        </Slide>
    </SlideContainer>
</StackLayout>

Result

Text is remains on the same line and is truncated at the edge of the screen.

Expected Behavior

Text on the label should wrap to the next line.

label-wrapping- n -slides

If you take that same label out of the Slide container and display it, it wraps correctly.

JoshDSommer commented 8 years ago

Hey @burkeholland Thanks for bringing this to my attention, Do you know if this is happening as well in android or if it's a iOS only behavior?

Also I was thinking about it and do you have a fixed width set on the label? even something like 100%? I'm thinking that may need to be the case and it has to do with the width of the slide not affecting the label inside.

Keep me posted and I'll check it out more tonight.

burkeholland commented 8 years ago

Done some digging and I've determined that this is actually a function of the SlideContainer extending the AbsoluteLayout. Labels do not wrap in AbsoluteLayouts. I'm going to investigate this further to see if this is expected or an issue with that layout container.

JoshDSommer commented 8 years ago

Hmm, I actually don't think I need the absolute layout anymore and may try to instead have it just extend the stack layout in the next release.

JoshDSommer commented 8 years ago

I take that back I need the absolute layouts. Did you find out anything about it being an issue or expected?

BMwanza commented 6 years ago

Any update on this? Having the same issue as of right now

BMwanza commented 6 years ago

Or is there some kind of way to work around this? Great plug by the way!

yoat commented 6 years ago

The example code has a Label immediately inside the Slide. It may be using AbsoluteLayout, maybe not. Regardless, I have gotten textWrap working in my slides by putting a StackLayout inside the Slide, wrapping the Label.

Maybe a GridLayout would work, I don't know, but StackLayout does.

I used slightly different syntax, but it all comes out the same:

` <slides #slides>

... `

BMwanza commented 6 years ago

Okay so you put the label wrapped inside a Stack layout? would you be able to send me the sample xml file?

BMwanza commented 6 years ago

@yoat Oh never mind I got it working thanks so much man!