Can't edit Entry within ListView, Forms 1.3.1 error

PaulCharltonPaulCharlton ✭✭GBMember ✭✭
edited January 2015 in Xamarin.Forms

Hi,

I've pasted a sample app below but I essentially have a set of Entries within a ListView, using a class inherited from ViewCell. The error I'm getting is when tapping the Entry.

Expected behaviour: Entry comes into focus and keyboard appears

Actual Behaviour: Entry flashes, cursor appears briefly and then disappears again. No keyboard activity.


public class App
{
public static Page GetMainPage()
{
return new NavigationPage(new TestPage());
}
}

public class TestPage : ContentPage
{
    public TestPage()
    {
        var holder = new StackLayout
        {
            Orientation = StackOrientation.Vertical,
            HorizontalOptions = LayoutOptions.FillAndExpand,
            VerticalOptions = LayoutOptions.Center,
            Padding = new Thickness(10, 0, 10, 20),
        };
        var listview = new ListView
        {
            RowHeight = 150,
            VerticalOptions = LayoutOptions.Center,
            ItemsSource = new List<string>{"",""},
            ItemTemplate = new DataTemplate(typeof(TestFieldCell)),
        };
        holder.Children.Add(listview);

        this.Content = holder;
    }
}

public class TestFieldCell:ViewCell
{
    protected override void OnBindingContextChanged()
    {
        base.OnBindingContextChanged();

        View = new Entry();
    }
}

This example app will work fine in forms version 1.2.3.6257, but fails in 1.3.1.6296. Is there something that I'm missing or is this a bug?

Thanks in advance,

Paul.

Best Answer

Answers

Sign In or Register to comment.