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

Embeding Android Fragment in Xamarin Forms Xaml

$
0
0

I want to find to embed fragment in xaml, through this page https://developer.xamarin.com/guides/xamarin-forms/platform-features/native-views.

here is my xaml code. which line is wrong?

    <?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:local="clr-namespace:XamarinFragment"
                 xmlns:androidWidget="clr-namespace:Android.Widget;assembly=Mono.Android;targetPlatform=Android"
                 xmlns:androidGraphics="clr-namespace:Android.Graphics;assembly=Mono.Android;targetPlatform=Android"
                 xmlns:formsAndroid="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.Platform.Android;targetPlatform=Android"
                 x:Class="XamarinFragment.MainPage">
        <ContentPage.Content>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Grid x:Name="fragmentContainer"
                      Grid.Row="0">
                    <androidWidget:Fragment />
                </Grid>
                <Grid Grid.Row="1" />
            </Grid>
        </ContentPage.Content>
    </ContentPage>

Viewing all articles
Browse latest Browse all 91519

Trending Articles