Closed Phenek closed 5 years ago
I am not seeing the behavior described. Please test the attached project and alter it such that it exhibits the problem. Thank you!
First thanks for your time,
I figured out, the only things that create this bug.
It's because I was using this flag in my MainActivity.cs:
Forms.SetFlags("FastRenderers_Experimental");
Obviously the Button FastRenderer is rendering on top of the visual stack. Seems this issue can be close or can be move to an experimental section.
Regards,
PS: Another thing with FastRenderers If you create a layout (AbsoluteLayout, Grid,.. "kind of layout that allows overlap") with a Xaml button in Xaml, then add another button programmatically to overlap the Xaml button. At this moment the Xaml button is on front overlapping everything, so Xaml have the priority to be on front, or it's rendering at the end?
Yep, you are correct! The FastRenderer Button sticks on top.
Priority should be given to whatever element is added to the layout last, regardless of XAML or programmatic. Your experience seems to be another artifact of FastRenderers not being layered properly.
Thanks!
Exactly similar to what I am facing with a catch. I am using a couple of frames and a label, the frames within each other seems fine in stacking, but when another type is introduced (Label), it goes behind even though it is should be at the forefront. This is only happening on Android (left), while in iOS (right), it is working.
<?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:local="clr-namespace:App3"
x:Class="App3.MainPage">
<AbsoluteLayout>
<Frame BackgroundColor="Green" AbsoluteLayout.LayoutBounds="0,0,200,30" HeightRequest="30" Padding="0"/>
<Frame BackgroundColor="Brown" AbsoluteLayout.LayoutBounds="0,0,150,30" HeightRequest="30" Padding="0"/>
<Label BackgroundColor="Purple" AbsoluteLayout.LayoutBounds="0,0,100,30" HeightRequest="30" Text="Hi" TextColor="White"/>
</AbsoluteLayout>
</ContentPage>
PS: RaiseChild() and LowerChild() does not work too.
@samhouts this is still an issue with fast renderers if you place the button on a layout (AbsoluteLayout, Grid,.. "kind of layout that allows overlap") and all of that into a ScrollView and into a NavigationPage it will duplicate the same behaviour as mentioned in the original bug
there is also a related issue with this, having the button on a layout (AbsoluteLayout, Grid,.. "kind of layout that allows overlap") with something in front of it, it I click the button it will come in front of the other visual elements
please see the test app I made for this scenarios https://github.com/WarBorg/TestActivityButtonXamForms
using latest Xamarin Framework 4.5.0.396 using Android 9.0 - api 28 emulator
switch to "UseLegacyRenderers"
PS please tell me if I need to create a new issue and I will do that, thank you
@WarBorg Yes, please create a new issue! Thank you!!!
Description
It's for now impossible to overlap a button on Android with another view.
Steps to Reproduce
Expected Behavior
The expected hierarchy of the visual stack would be:
Actual Behavior
The button is stuck on the front of the visual stack.
Basic Information