nativescript-slides
nativescript-slides copied to clipboard
Label textWrap not working in Slide
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.
If you take that same label out of the Slide container and display it, it wraps correctly.
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.
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.
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.
I take that back I need the absolute layouts. Did you find out anything about it being an issue or expected?
Any update on this? Having the same issue as of right now
Or is there some kind of way to work around this? Great plug by the way!
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> ...
Okay so you put the label wrapped inside a Stack layout? would you be able to send me the sample xml file?
@yoat Oh never mind I got it working thanks so much man!