Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlowListView HasUnevenRows="true" doesn't work ? #17

Closed
lwinged opened this issue Aug 15, 2016 · 4 comments
Closed

FlowListView HasUnevenRows="true" doesn't work ? #17

lwinged opened this issue Aug 15, 2016 · 4 comments

Comments

@lwinged
Copy link

lwinged commented Aug 15, 2016

With a Xamarin ListView the HasUnevenRows property works but not with FlowListView I dont understand why.

My label overlaps other cells with the FlowListView, it works with simple ListView.

Can I replace FlowListViewInternalCell with my custom view cell not a custom contentview like in your example ?

Thank you very much for your help.

the code below :

Page

using System;
using System.Collections.Generic;
using System.Diagnostics;
using DLToolkit.Forms.Controls;
using Xamarin.Forms;

namespace XamTest
{
    public partial class FlowListViewPage : ContentPage
    {
        public FlowListViewPage()
        {
            InitializeComponent();

            var lorem = "Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les années 1500, quand un peintre anonyme assembla ensemble des morceaux de";

            var list = new List<Person>() {
                new Person { Age = 52, Name = "test"},
                new Person { Age = 45, Name = lorem},
                new Person { Age = 45, Name = lorem},
                new Person { Age = 55, Name = "tes"},
                new Person { Age = 51, Name = "t6u"},
            };

            var columnsTemplates = new List<FlowColumnTemplateSelector>();

            columnsTemplates.Add(new FlowColumnSimpleTemplateSelector() { ViewType = typeof(FlowCellContentView) });

            flView.FlowColumnsTemplates = columnsTemplates;
            flView.FlowItemsSource = list;
        }

    }
}

Page Xaml

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage 
        xmlns="http://xamarin.com/schemas/2014/forms"
        xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
        xmlns:views="clr-namespace:XamTest;assembly=XamTest"
        xmlns:flv="clr-namespace:DLToolkit.Forms.Controls;assembly=DLToolkit.Forms.Controls.FlowListView" 
        x:Class="XamTest.FlowListViewPage">
    <ContentPage.Content>
        <flv:FlowListView x:Name="flView" HasUnevenRows="true">    
        </flv:FlowListView>
    </ContentPage.Content>
</ContentPage>

FlowCellContentView (not really a ViewCell)

using System;
using System.Collections.Generic;
using System.Diagnostics;
using Xamarin.Forms;

namespace XamTest
{
    public partial class FlowCellContentView : ContentView
    {
        public FlowCellContentView()
        {
            InitializeComponent();
        }
    }
}

FlowCellContentView Xaml

<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="XamTest.FlowCellContentView">
    <ContentView.Content>
        <StackLayout BackgroundColor="Blue">
            <Label Text="{Binding Name}"/>
        </StackLayout>
    </ContentView.Content>
</ContentView>

@daniel-luberda
Copy link
Owner

daniel-luberda commented Sep 12, 2016

You just need to set correct HorizontalOptions and VerticalOptions layout flags on a main cell view.

@kaidale
Copy link

kaidale commented Jan 9, 2017

Which version of xamarin.forms package supported for flowlistview.

@daniel-luberda
Copy link
Owner

@kaidale It should work on all 2.x versions

@kaidale
Copy link

kaidale commented Jan 10, 2017

Yes daniel.
its working when i update same version of xamarin.forms package in all project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants