ContentPresenter and ContentView in xamarin forms


ContentPresenter :


A layout manager for templated views. Used within a ControlTemplate to mark where the content to be presented
appears.







ContentView :


An element with a single content. ContentView has very little use of its own. Its purpose is to serve as a base class
for user-defined compound views.



* XAML

<ContentView>
<Label Text="Hi, I'm a simple Label inside of a simple ContentView"
HorizontalOptions="Center"
VerticalOptions="Center"/>
</ContentView>

* Code

var contentView = new ContentView {
Content = new Label {
Text = "Hi, I'm a simple Label inside of a simple ContentView",
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center
}
};

Comments

Popular posts from this blog

ScrollView in xamarin forms

Checkbox and RadioButon in xamarin forms

Navigation in Xamarin.Forms