Xamarin.Forms icon indicating copy to clipboard operation
Xamarin.Forms copied to clipboard

[Bug] [Android] TabbedPage overrides Entry values when more than 4 Pages are added

Open Kornelis opened this issue 5 years ago • 8 comments

Description

When using a TabbedPage with more than 4 Sub-Pages containting Entry Controls, the Entry Texts of the first Tab get overwritten when the >= 5th Tab is selected.

Steps to Reproduce

  1. Create TabbedPage
  2. Add 6 ContentPages containing a StackLayout with e.g. 4 Entry Controls
  3. Set different Texts on all Entry Controls
  4. Start the Application and swipe / select through Tabs
  5. When reaching Tab Nr. 5 select Tab Nr. 1 on the Tabbar

Expected Behavior

All Entry Controls on Tab 1 have their inital Text value set

Actual Behavior

All Entry Controls on Tab 1 have the Text Value of the last Entry Control set

Basic Information

  • Version with issue: 3.6.0.344457

  • Last known good version:

  • IDE: Visual Studio 2019

  • Platform Target Frameworks:

    • Android: 9.0
  • Android Support Library Version: 28.0.0.1

  • Nuget Packages: Xamarin.Forms: 3.6.0.344457 Xamarin.Android.Support.Design: 28.0.0.1 Xamarin.Android.Support.v7.AppCompat: 28.0.0.1 Xamarin.Android.Support.v4: 28.0.0.1 Xamarin.Android.Support.v7.CardView: 28.0.0.1 Xamarin.Android.Support.v7.MediaRouter: 28.0.0.1 Xamarin.Android.Support.Core.Utils: 28.0.0.1 Xamarin.Android.Support.CustomTabs: 28.0.0.1 Xamarin.Essentials: 1.1.0 Xamarin.Forms.Visual.Material: 3.6.0.344457

  • Affected Devices: Samsung Galaxy A5 (2017) running Android 8.0 Samsung Galaxy Tab S4 running Android 9.0

Screenshots

TabbedPageEntryIssue

Reproduction Link

TabbedPageEntryIssue.zip

Kornelis avatar May 22 '19 13:05 Kornelis

6188

MaxenceSAUNIER avatar May 22 '19 14:05 MaxenceSAUNIER

Thanks for the Hint. When setting Visual="" on the TabbedPage Element, everything is working as expected. But disabling the Material Visual isn't an option anymore... :(

Kornelis avatar May 22 '19 14:05 Kornelis

Yes I agree.

MaxenceSAUNIER avatar May 22 '19 14:05 MaxenceSAUNIER

Hm, getting a deployment error: image

kingces95 avatar May 22 '19 23:05 kingces95

Shane, let us know if you have better luck deploying.

kingces95 avatar May 22 '19 23:05 kingces95

Any news ?

MaxenceSAUNIER avatar Jan 24 '20 16:01 MaxenceSAUNIER

Hi,

This is turning out to be a big issue for me.

I have a form on my android application that consists of 8 tabs. As soon as I skipped the 5th tab, it is hiding the bound values on the first tab even though they are still attached to the bindingcontext. Then, when I move onto the 6th tab, it hides the bound values of the second tab, and so on and so forth.

Same issue as @Kornelis.

Is this being looked at?

Thanks.

SteveGrixti avatar Aug 11 '20 15:08 SteveGrixti

Hi,

This is turning out to be a big issue for me.

I have a form on my android application that consists of 8 tabs. As soon as I skipped the 5th tab, it is hiding the bound values on the first tab even though they are still attached to the bindingcontext. Then, when I move onto the 6th tab, it hides the bound values of the second tab, and so on and so forth.

Same issue as @Kornelis.

Is this being looked at?

Thanks.

UPDATE:

Just to let everyone know, I managed to get around this by making use of the Android specific method SetOffscreenPageLimit() as shown below. Issue no longer occurs.

Children.Add(new Page());
Children.Add(new Page());
Children.Add(new Page());
Children.Add(new Page());
Children.Add(new Page());
Children.Add(new Page());
Children.Add(new Page());
Children.Add(new Page());

On<Android>().SetOffscreenPageLimit(10);

SteveGrixti avatar Aug 12 '20 08:08 SteveGrixti