Issue
I have a problem. I created an example project to solve it but I didn't succeed. I created a button with a negative margin to be in the middle of the navigation bar. The tap only works on the lower part.
MainPage.xaml:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="HelloWorld.MainPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<Frame HeightRequest="56"
Margin="0"
Padding="0"
BackgroundColor="Yellow" />
<Grid>
<Frame WidthRequest="56"
HeightRequest="56"
Margin="0,-28,0,0"
Padding="0"
HorizontalOptions="Center"
VerticalOptions="Start"
BackgroundColor="Blue"
CornerRadius="28">
<Frame.GestureRecognizers>
<TapGestureRecognizer Command="{Binding TapCommand}" />
</Frame.GestureRecognizers>
</Frame>
</Grid>
</Grid>
</Grid>
</ContentPage>
Xamarin.Forms: 4.2.0.815419
Solution
Solution
<?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" mc:Ignorable="d" x:Class="helloworld.MainPage">
<Grid RowSpacing="0">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<ListView Grid.Row="0" BackgroundColor="Red"/>
<Frame Grid.Row="1" BackgroundColor="Yellow" Padding="0">
</Frame>
<Grid Grid.Row="1" TranslationY="-28">
<Frame WidthRequest="56"
HeightRequest="56"
Margin="0"
Padding="0"
HorizontalOptions="Center"
VerticalOptions="Start"
BackgroundColor="Blue"
CornerRadius="28">
<Frame.GestureRecognizers>
<TapGestureRecognizer Tapped="OnTapped" />
</Frame.GestureRecognizers>
</Frame>
</Grid>
</Grid>
</ContentPage>
Answered By - lsaudon
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.