Posts

Showing posts from January, 2023

Map in xamarin form

Image
  Maps in xamarin forms Please, support my blog by clicking on our sponsors ad! First Add Nugget in all projects Xamarin.Forms.Map Lets Configure in IOS project to show map in iphone  In AppDelegate.cs file, Initialize the map below "global::Xamarin.Forms.Forms.Init();" line in "FinishedLaunching" method FormsMaps.Init(); Add following key in info.plist for permission <key>NSLocationWhenInUseUsageDescription </key> <string>Allow map to access to your location while you use the app.</string> <key>NSLocationAlwaysAndWhenInUseUsageDescription</key> <string>Always Allow map to access to your location</string> <key>NSLocationUsageDescription</key> <string>We would like to show you a map</string> <key>NSLocationAlwaysUsageDescription</key> <string>We would like to show you a map</string> Now Let's configure for android proj

Part 8 - Absolute Layout in Xamarin form

Image
 Absolute layout is used to position and size children using explicit values. The position is specified by the upper-left corner of the child relative to the upper-left corner of the AbsoluteLayout, in device independent units.Absolute Layout also implement proportional positioning and sizing feature. Please, support my blog by clicking on our sponsors ad! The Absolute Layout has two properties: LayoutBounds LayoutFlags Layout Bounds The default value is (0,0,Autosize,Autosize). The Parameter is as X,Y,Width,Height. LayoutFlags The default value of this property is AbsoluteLayoutFlags.None. This property indicates that the position and size are interpreted proportionally. Proportional values are from 0-1. 0 indicates 0% and 1 indicates 100%. If you want to use 50% then value will be 0.5 Values are as follow: None This is default value. this is autosize/fixed value. XProportional Indicates that what percentage X of parent should use, while other are absolute values YPropor

Xamarin Tutorial Part 6 - Grid in code

Image
 Before you start with this blog, go to this syntax and tutorial blog. It will easy to understand the code of this blog. Grid through cs code Grid in xaml Please, support my blog by clicking on our sponsors ad! Below code for grid in c# Code. This is recommended when it has to add at runtime. By default you can add grid through xaml, Because xaml is easy to code and understand. var grid = new Grid(); var autoRow = new RowDefinition() { Height = new GridLength(1, GridUnitType.Auto) }; var fixRow = new RowDefinition() { Height = new GridLength(200) }; var starRow = new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) }; var col1 = new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }; var col2 = new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }; var col3 = new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }; var col4 = new ColumnDefinition() { Width = new GridLength(

Xamarin Tutorial Part 5 - Grid in xaml

Image
In Previous blog  we learn syntax of grid, we will go through example of grid in xaml. Grid code in xamarin form in xaml Please, support my blog by clicking on our sponsors ad! Grid code for above design <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="GridExample.MainPage"> <Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,*" ColumnDefinitions="Auto,Auto,Auto,Auto,*"> <BoxView BackgroundColor="Black" Grid.Row="0" Grid.Column="0"></BoxView> <BoxView BackgroundColor="Gray" Grid.Row="1" Grid.Column="0"></BoxView> <BoxView BackgroundColor="Green" Grid.Row="2" Grid.Column="0" ></BoxView> <BoxView BackgroundColor="Yellow" Grid.Row="3" Grid.C