nativescript-slides icon indicating copy to clipboard operation
nativescript-slides copied to clipboard

Label textWrap not working in Slide

Open burkeholland opened this issue 8 years ago • 9 comments

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.

burkeholland avatar Jul 12 '16 20:07 burkeholland

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.

JoshDSommer avatar Jul 13 '16 11:07 JoshDSommer

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.

burkeholland avatar Jul 14 '16 16:07 burkeholland

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 avatar Jul 14 '16 18:07 JoshDSommer

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

JoshDSommer avatar Jul 29 '16 00:07 JoshDSommer

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

BMwanza avatar Nov 01 '18 12:11 BMwanza

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

BMwanza avatar Nov 01 '18 13:11 BMwanza

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:

<StackLayout row="1"> <slides #slides> <slide class="slide-1"> <StackLayout> <Label class="content" text="Long wrapping text. Long wrapping text. Long wrapping text. Long wrapping text. Long wrapping text." textWrap="true"></Label> </StackLayout> </slide> ...

yoat avatar Nov 01 '18 16:11 yoat

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

BMwanza avatar Nov 01 '18 16:11 BMwanza

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

BMwanza avatar Nov 01 '18 18:11 BMwanza