Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Listview with Custom ViewCell -> Textcontent reaches in next Cell

$
0
0

When I create a custom ViewCell with (to keep it simple) just two Labels in it, I have a problem with long texts.
I create a layout like this and set it to the "View" Property of the ViewCell. Unfortunately the content of the first ViewCell reaches into the bounds of the second view cell.

var lblSubject = new Label
{
    HorizontalOptions= LayoutOptions.FillAndExpand,
    VerticalOptions=LayoutOptions.Start,
    LineBreakMode=LineBreakMode.NoWrap,
    Font=Font.SystemFontOfSize(NamedSize.Medium)
};
var lblInfos = new Label
{
    HorizontalOptions = LayoutOptions.Fill,
    VerticalOptions=LayoutOptions.Start,
    LineBreakMode=LineBreakMode.WordWrap,
    Font=Font.SystemFontOfSize(NamedSize.Small)

};

var nameLayout = new StackLayout()
{
    HorizontalOptions = LayoutOptions.Fill,
    VerticalOptions=LayoutOptions.Fill,
    Orientation = StackOrientation.Vertical,
    Spacing=0,
    Padding=new Thickness(10,0),
    Children = { lblSubject, lblInfos }
};

To keep it simple, I let the bindings away.
Any Idea why the contents of the cells are overlapping?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>