xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

[Bug] Android Entry on appearing weird effect upon Forms 4.4 #8986

Closed taublast closed 4 years ago

taublast commented 4 years ago

Description

After upgrading forms from 4.3 to 4.4 all android entries now show an ugly fading indicator upon page appearing. In different projects, different layouts and pages, with or without any custom renderer, the only thing that made that happend was forms 4.4, on 4.3 it's all fine.

You can see animated gif and get more info here: https://forums.xamarin.com/discussion/comment/398840

Repro project is here: https://github.com/taublast/droidentrybug

Steps to Reproduce

run repro project

or

  1. put entry inside frame with a scrollview above using forms 4.4
  2. open this page

Expected Behavior

as in Forms 4.3 and below, nothing special.

Actual Behavior

a wierd fading out rectangle upon apearing

Basic Information

forms 4.3

Screenshots

https://us.v-cdn.net/5019960/uploads/editor/mf/oewnktd9pug2.gif https://us.v-cdn.net/5019960/uploads/editor/p4/cxpw3ulizwmk.gif

more here: https://forums.xamarin.com/discussion/comment/398840

Reproduction Link

https://github.com/taublast/droidentrybug

jfversluis commented 4 years ago

Interesting. Seems to be linked to #8626, but clearly it's not exclusive to CollectionView and the linked issue also already shows in 4.3.

Verified that this shows in the reproduction. Only in a ScrollView (or similar) though.

LGFox commented 4 years ago

I observe the same glitch on v. 4.4. I checked it on Samsung devices API26/API27. I see this glitch on some labels as well. It worked well on v. 4.3. iOS works well on v. 4.4. Rolled back to 4.3 for now.

LanceMcCarthy commented 4 years ago

I can confirm this happens with Labels as well. A solid bar is visible, which then animates down to the bottom of the view over the course of ~1.5s (instead of upwards as seen in OP's GIF).

truedem0n commented 4 years ago

did anyone find a fix for this? I have the same issue happening inside a collectionview but with forms9patch

taublast commented 4 years ago

just use forms 4.3

APopatanasov commented 4 years ago

When is this issue expected to be fixed? Currently, I cannot update to the latest version of Xamarin.Forms because of it. Downgrading to 4.3 is also not an appropriate solution because there are fixes in 4.4 that I need.

Huaba93 commented 4 years ago

Same problem with Forms 4.4.0.991640 and Labels.

Working:

Not working:

Screenshot_20200210-124220_Dtonestro - learn Recorder

Reveon commented 4 years ago

I am having the same problem on 4.5.0.266-pre3. Labels in CollectionView and BindableLayout (StackLayout).

brminnick commented 4 years ago

I can confirm this is still exists in v4.5.0.356 when using a CollectionView

Here's a reproduction:

IsRefreshing is true While Scrolling Not Refreshing or Scrolling
Screenshot_1583081198 Screenshot_1583081270 Screenshot_1583081203
brminnick commented 4 years ago

Work Around

As a workaround, in your Android project, add a custom renderer and set Control.VerticalScrollBarEnabled = false;.

I added this Label custom renderer recommended here to solve the problem for Labels in my app.

Here's the complete source code, for reference: https://github.com/brminnick/GitTrends

using Android.Content;
using GitTrends.Droid;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;

//workaround for this issue: https://github.com/xamarin/Xamarin.Forms/issues/8626 and https://github.com/xamarin/Xamarin.Forms/issues/8986

[assembly: ExportRenderer(typeof(Label), typeof(LabelCustomRenderer))]
namespace GitTrends.Droid
{
    class LabelCustomRenderer : Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer
    {
        public LabelCustomRenderer(Context context) : base(context)
        {

        }

        protected override void OnElementChanged(ElementChangedEventArgs<Label> e)
        {
            base.OnElementChanged(e);

            if (Control is null || e.NewElement is null)
                return;

            Control.VerticalScrollBarEnabled = false;
        }
    }
}
IsRefreshing is true While Scrolling Not Refreshing or Scrolling
Screenshot_1583082257 Screenshot_1583082262 Screenshot_1583082259