MainPage.xaml
<?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="TestMobileApp.MainPage"> <StackLayout Margin="5"> <!-- Place new controls here --> <Expander> <Expander.Header> <Label Text="Click here to expand/collapse Content" FontAttributes="Bold" FontSize="Medium" /> </Expander.Header> <StackLayout> <Label Text="Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockups" /> </StackLayout> </Expander> </StackLayout> </ContentPage>
Note: Make Sure you have set the Expander_Experimental flag in Android & iOS Project.
Android:- MainActivity.cs
protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); Xamarin.Forms.Forms.SetFlags("Expander_Experimental"); Xamarin.Essentials.Platform.Init(this, savedInstanceState); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); LoadApplication(new App()); }
iOS:- AppDelegate.cs
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { Xamarin.Forms.Forms.SetFlags("Expander_Experimental"); global::Xamarin.Forms.Forms.Init(); LoadApplication(new App()); return base.FinishedLaunching(app, options); }
No comments:
Post a Comment