dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.95k stars 1.7k forks source link

Scrolled event in scrollview not working #7119

Open tjiakwokyung28 opened 2 years ago

tjiakwokyung28 commented 2 years ago

Description

please check scrolview, this control having trouble, thats not working 1.both orientation 2.scroll event 3.vertical scroll not working too

Steps to Reproduce

<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MauiScrollView.MainPage">

<ScrollView Orientation="Both"
            Scrolled="ScrollView_Scrolled">
    <AbsoluteLayout
                x:Name="KanvasLayout"
                BackgroundColor="White"
                HeightRequest="2610"
                WidthRequest="2610">
        <Image
            Source="dotnet_bot.png"
            SemanticProperties.Description="Cute dot net bot waving hi to you!"
            HeightRequest="200"
            HorizontalOptions="Center" />

        <Label 
            Text="Hello, World!"
            SemanticProperties.HeadingLevel="Level1"
            FontSize="32"
            HorizontalOptions="Center" />

        <Label 
            Text="Welcome to .NET Multi-platform App UI"
            SemanticProperties.HeadingLevel="Level2"
            SemanticProperties.Description="Welcome to dot net Multi platform App U I"
            FontSize="18"
            HorizontalOptions="Center" />

        <Button 
            x:Name="CounterBtn"
            Text="Click me"
            SemanticProperties.Hint="Counts the number of times you click"
            Clicked="OnCounterClicked"
            HorizontalOptions="Center" />
    </AbsoluteLayout>

</ScrollView>

error and not detect in code:

namespace MauiScrollView;

public partial class MainPage : ContentPage { int count = 0;

public MainPage()
{
    InitializeComponent();
}

private void OnCounterClicked(object sender, EventArgs e)
{
    count++;

    if (count == 1)
        CounterBtn.Text = $"Clicked {count} time";
    else
        CounterBtn.Text = $"Clicked {count} times";

    SemanticScreenReader.Announce(CounterBtn.Text);
}

private void ScrollView_Scrolled(object sender, ScrolledEventArgs e)
{
    string test = "";
    test = "error - not working";
    //not working
    //error
}

}

Version with bug

Release Candidate 3 (current)

Last version that worked well

Release Candidate 3 (current)

Affected platforms

Android

Affected platform versions

??

Did you find any workaround?

No response

Relevant log output

No response

v-longmin commented 2 years ago

Verified repro on Android 12.0 with VS 17.3.0 Preview 1.0 [32427.505.main]. Repro with above code.

jsuarezruiz commented 2 years ago

Cannot reproduce the issue on Android. scroll-issue

Could you attach a small sample where reproduce the issue?

ghost commented 2 years ago

Hi @tjiakwokyung28. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

tjiakwokyung28 commented 2 years ago

change to horizontal orientation then look into scroll event, that not working or not detection

On Tue, May 17, 2022 at 4:46 PM msftbot[bot] @.***> wrote:

Hi @tjiakwokyung28 https://github.com/tjiakwokyung28. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

— Reply to this email directly, view it on GitHub https://github.com/dotnet/maui/issues/7119#issuecomment-1128656209, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZAG5PH5NPWH3OAWSJLZGETVKNTGFANCNFSM5VZW4BAA . You are receiving this because you were mentioned.Message ID: @.***>

PureWeen commented 2 years ago

change to horizontal orientation then look into scroll event, that not working or not detection On Tue, May 17, 2022 at 4:46 PM msftbot[bot] @.> wrote: Hi @tjiakwokyung28 https://github.com/tjiakwokyung28. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. — Reply to this email directly, view it on GitHub <#7119 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZAG5PH5NPWH3OAWSJLZGETVKNTGFANCNFSM5VZW4BAA . You are receiving this because you were mentioned.Message ID: @.>

@v-longmin can you try again to reproduce with latest bits?

VincentBu commented 2 years ago

repro on android simulator

hartez commented 2 years ago

With the latest in the net6.0 branch, the Scrolled event is working. However, if the ScrollView's direction is set to "both", the vertical scrolling is not working.

tjiakwokyung28 commented 1 year ago

Vertical event it's ok, but horizontal is not detection, not working

On Tue, May 17, 2022 at 4:46 PM Javier Suárez @.***> wrote:

Cannot reproduce the issue on Android. [image: scroll-issue] https://user-images.githubusercontent.com/6755973/168782320-1ec50fcc-efd5-4056-a712-5805244fe124.gif

Could you attach a small sample where reproduce the issue?

— Reply to this email directly, view it on GitHub https://github.com/dotnet/maui/issues/7119#issuecomment-1128656031, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZAG5PDWYCV3CY4QA7NVX3LVKNTFRANCNFSM5VZW4BAA . You are receiving this because you were mentioned.Message ID: @.***>

ghost commented 1 year ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

XamlTest commented 1 year ago

Verified this on Visual Studio Enterprise 17.6.0 Preview 5.0. This issue repro on Android emulator (13.0-API 33) with below Project: 7119.zip

If set Orientation="Both", horizontal scrolling is working, vertical scrolling is not working. Both

If set Orientation="Horizontal", horizontal scrolling is working, vertical scrolling is not working. If set Orientation="Vertical", horizontal scrolling is not working, vertical scrolling is working.