If you're finding a way how to design a buton over the controls, it looks like this:
<ContentPage.Content> <RelativeLayout> <Grid> <Grid.RowDefinitions> <RowDefinition Height="30" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.Triggers> <DataTrigger TargetType="Grid" Binding="{Binding IsBusy}" Value="True"> <Setter Property="IsVisible" Value="False" /> </DataTrigger> </Grid.Triggers> <StackLayout Grid.Row="0" Grid.Column="0"> <Label Text="List" FontAttributes="Bold" FontSize="Large" VerticalOptions="Start" HorizontalOptions="Center" Margin="0, 0, 0, 0" /> </StackLayout> <StackLayout Grid.Row="1" Grid.Column="0" Margin="10"> <ListView x:Name="list" ItemsSource="{Binding List}" IsVisible="True" SeparatorVisibility="Default" HasUnevenRows="true" ItemTapped="List_ItemTapped" SelectionMode="Single"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <StackLayout x:Name="Item" Orientation="Horizontal" HeightRequest="190" > <StackLayout.GestureRecognizers> <TapGestureRecognizer NumberOfTapsRequired="1" Tapped="Item_TapGestureRecognizer_Tapped_1" CommandParameter="{Binding Source={x:Reference Item}, Path=BindingContext}" /> </StackLayout.GestureRecognizers> </StackLayout> </ViewCell> </DataTemplate> </ListView.ItemTemplate> </ListView> <Label Text="Brak kart w aplikacji" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" IsVisible="{Binding IsEmpty}" /> </StackLayout> <ContentView Grid.Row="0" Grid.Column="0" IsVisible="{Binding IsBusy}" BackgroundColor="#222222" Opacity="0.5" AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1" > <ActivityIndicator IsRunning="True" Color="{StaticResource ButtonBackgroundColor}" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" /> </ContentView> </Grid> <RelativeLayout x:Name="PlusButton" WidthRequest="100" HeightRequest="100" HorizontalOptions="End" VerticalOptions="End" RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Y, Factor=0,Constant=0}" RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=X, Factor=1, Constant=0}" RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1,Constant=0}" RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width,Factor=1,Constant=0}" > <ImageButton Source="plus.png" BackgroundColor="Transparent" Clicked="PlusButton_Clicked" /> </RelativeLayout> </RelativeLayout> </ContentPage.Content> </ContentPage>
Bold is actually that RelativeLayout with the plus Image (buton). If you'd like to move the buton somewhere else, you have to change Factor value.
Немає коментарів:
Дописати коментар