Closed marufbd closed 4 years ago
iOS or Android?
Android I tested. Just changed on the example touchview.sample xamarin forms view.
Android I tested. Just changed on the example touchview.sample xamarin forms view.
but it works on my sample, right?
That's odd
Set InputTransparent="True" to all views inside your FlexLayout
<?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:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:touch="clr-namespace:TouchEffect;assembly=TouchEffect"
mc:Ignorable="d"
x:Class="TouchEffectSample.ScrollPage">
<ContentPage.Content>
<StackLayout VerticalOptions="Center">
<ScrollView Orientation="Horizontal" VerticalOptions="Center">
<StackLayout HorizontalOptions="Start" Spacing="10" Orientation="Horizontal">
<FlexLayout
touch:TouchEff.NativeAnimation="True"
touch:TouchEff.NativeAnimationColor="Red"
Direction="Column">
<FlexLayout.Effects>
<touch:TouchEff Completed="Completed"/>
</FlexLayout.Effects>
<BoxView InputTransparent="True" WidthRequest="142" HeightRequest="80" BackgroundColor="DarkGray">
</BoxView>
<Label InputTransparent="True" MaxLines="1" Padding="5" Text="content" Opacity="0.6" BackgroundColor="Black"/>
</FlexLayout>
<FlexLayout
touch:TouchEff.NativeAnimation="True"
touch:TouchEff.NativeAnimationColor="Red"
Direction="Column">
<FlexLayout.Effects>
<touch:TouchEff Completed="Completed"/>
</FlexLayout.Effects>
<BoxView InputTransparent="True" WidthRequest="142" HeightRequest="80" BackgroundColor="DarkGray">
</BoxView>
<Label InputTransparent="True" MaxLines="1" Padding="5" Text="content" Opacity="0.6" BackgroundColor="Black"/>
</FlexLayout>
<FlexLayout
touch:TouchEff.NativeAnimation="True"
touch:TouchEff.NativeAnimationColor="Red"
Direction="Column">
<FlexLayout.Effects>
<touch:TouchEff Completed="Completed"/>
</FlexLayout.Effects>
<BoxView InputTransparent="True" WidthRequest="142" HeightRequest="80" BackgroundColor="DarkGray">
</BoxView>
<Label InputTransparent="True" MaxLines="1" Padding="5" Text="content" Opacity="0.6" BackgroundColor="Black"/>
</FlexLayout>
</StackLayout>
</ScrollView>
</StackLayout>
</ContentPage.Content>
</ContentPage>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TouchEffect.Enums;
using TouchEffect.EventArgs;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace TouchEffectSample
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class ScrollPage : ContentPage
{
public ScrollPage()
{
InitializeComponent();
}
private void Completed(VisualElement sender, TouchEffect.EventArgs.TouchCompletedEventArgs args)
{
Application.Current.MainPage.DisplayAlert("Clicked on a square", "The Completed event was fired", "Cancel");
}
}
}
Thanks heaps.
If i press and scroll outside the view that leaves the pressed view backgorund as red.
Sample View:
Coe behind:
Nothing fires after press and scroll.