Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Floating Action Button with Listview inside a TabbedPage.

$
0
0

I want to add a FAB in a view having listview that is in TabbedPage ContentPage.
Here's my code...Error XLS0501 The property 'Content' is set more than once.

<TabbedPage xmlns="..."
        xmlns:x="..."
        xmlns:fab="clr-namespace:FAB.Forms;assembly=FAB.Forms"
        x:Class="IIOT_PB.Views.DevView" Title="{DynamicResource projectopen}" BarBackgroundColor="#1976D2">
<ContentPage Title="Devices">
    <ContentPage.Content>
        <ListView x:Name="devicesList" VerticalOptions="Fill" HorizontalOptions="Fill"
                      SeparatorVisibility="Default" RowHeight="55" BackgroundColor="{DynamicResource backgroundColor}"
                      ItemTapped="DevicesList_ItemTapped" SelectionMode="None">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <StackLayout Orientation="Horizontal" VerticalOptions="Fill" HorizontalOptions="Fill">
                                <StackLayout VerticalOptions="StartAndExpand" HorizontalOptions="StartAndExpand"
                                         Orientation="Vertical">
                                    <Label Text="{Binding name}"
                                       FontSize="Small" FontAttributes="Bold"
                                       VerticalOptions="Start"
                                       TextColor="{DynamicResource textColor}"/>
                                    <Label Text="{Binding description}" LineBreakMode="TailTruncation" WidthRequest="250"
                                       FontSize="Small"
                                       VerticalOptions="StartAndExpand"
                                       TextColor="{DynamicResource textColor}"/>
                                </StackLayout>
                                <ImageButton Padding="15,15,15,15" Source="about.png" Clicked="Button_Clicked" VerticalOptions="End" AutomationId="{Binding id}" HorizontalOptions="Fill" BackgroundColor="Transparent"/>
                            </StackLayout>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
            <fab:FloatingActionButton x:Name="FAB" HorizontalOptions="CenterAndExpand" WidthRequest="50" HeightRequest="50"  VerticalOptions="CenterAndExpand"/>
    </ContentPage.Content>
    </ContentPage>

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>