Download presentation
Presentation is loading. Please wait.
1
XAML and Controls Telerik School Academy http://schoolacademy.telerik.com Xamarin apps for iOS, Android & WinPhone
2
1. Overview 2. Requirements Mac Requirements Windows Requirements 3. Xamarin.Forms App 4. Controls Views – Button, Label, Entry, ListView, Cells Pages – ContentPage, MasterDetailPage… Layouts – Managed/Unmanaged Layouts 2
3
3
4
Allow cross platform user interfaces Allow for rapid prototyping Rendered using native controls Written with C# and XAML Does not have the limitations of other toolkits Browser sandboxing Limited APIs Poor performance 4
5
Possible to create applications part with Xamarin.Forms, part with native UI toolkit Can be written for Android 4.0 or higher iOS 6.1 or higher Windows Phone 8 or higher 5
6
6
7
Mac System Requirements Xamarin Studio 5 – for applications on OS X Xcode 5 – to develop iOS applications Windows Phone apps cannot be developed on OS X Windows System Requirements Windows 8 operating system VS 2013 with the Windows Phone SDK installed Visual Studio 2013 Update 2 iOS and Android can be built on any Windows 7
8
8
9
Xamarin.Forms solution will contain: Portable Library Xamarin.Android Application Xamarin.iOS Application Windows Phone Application 9
10
A Xamarin.Forms.Page represents: Activity in Android View Controller in iOS Page in Windows Phone public class App { public static Page GetMainPage() public static Page GetMainPage() { return new ContentPage return new ContentPage { Content = {... } Content = {... } }; }; }} 10
11
11
12
12
13
The building blocks of the UI Commonly known as controls Xamarin Forms supports: Button, Label, Entry, Editor Image, BoxView, Slider, Stepper, Switch Picker, DatePicker, TimePicker ListView, TableView, WebView ActivityIndicator, ProgressBar, SearchBar http://developer.xamarin.com/guides/cross- platform/xamarin-forms/controls/views/ http://developer.xamarin.com/guides/cross- platform/xamarin-forms/controls/views/ http://developer.xamarin.com/guides/cross- platform/xamarin-forms/controls/views/ 13
14
A button view which reacts to touch Button button = new Button { Text = "Click Me!", Font = Font.SystemFontOfSize(NamedSize.Large), BorderWidth = 1, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.CenterAndExpand }; button.Clicked += OnButtonClicked; 14
15
A view that displays text Label lbl = new Label { Text = "Hello, Forms!", Font = Font.SystemFontOfSize(NamedSize.Large), VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; 15
16
A control that can edit a single line of text var usernameEntry = new Entry { Placeholder = "Username“, }; usernameEntry.TextChanged += usernameEntry_TextChanged; usernameEntry.Focused += usernameEntry_Focused; usernameEntry.Unfocused += usernameEntry_Unfocused; var passwordEntry = new Entry { Placeholder = "Password", IsPassword = true }; 16
17
A view that allows date picking DatePicker datePicker = new DatePicker { Format = "D", VerticalOptions = LayoutOptions.CenterAndExpand }; 17
18
ItemsView that displays a collection of data ListView listView = new ListView { ItemsSource = people, ItemTemplate = new DataTemplate(() => { return new ViewCell() { View =... } } }; 18
19
A Cell is a specialized element used to describe how each item in a list should be drawn Cells are elements designed to be added to ListView or TableView Xamarin Forms supports: ViewCell – ViewCell – containing a developer-defined View EntryCell, SwitchCell, TextCell, ImageCell <TextCell Text="{Binding Name}" Detail="{Binding DateOfBirth}"/> Detail="{Binding DateOfBirth}"/> 19
20
20
21
ContentPage – display a single View MasterDetailPage – manages two panes of info NavigationPage – manages a stack of other pages TabbedPage – allows navigation using tabs CarouselPage – swipe gestures between subpages 21
22
22
23
The Layout class acts as a container for other Layouts or Views It typically contains logic to set the position and size of child elements Managed Layouts – StackLayout Takes care of positioning and sizing of children Unmanaged Layouts – AbsoluteLayout The user will specify the size and position of the child control 23
24
ContentView An element with a single content Serves as a base class for user-defined compound veiws StackLayout Positions child elements in a single line Orientation: Vertical or Horizontal ScrollView Capable of scrolling if the Content requires it 24
25
Grid Arranges views in rows and columns Frame Has a single child with some framing options AbsoluteLayout Positions child elements at absolute requested positions RelativeLayout Uses Constraints to layout its children 25
26
Demo 26
27
форум програмиране, форум уеб дизайн курсове и уроци по програмиране, уеб дизайн – безплатно програмиране за деца – безплатни курсове и уроци безплатен SEO курс - оптимизация за търсачки уроци по уеб дизайн, HTML, CSS, JavaScript, Photoshop уроци по програмиране и уеб дизайн за ученици ASP.NET MVC курс – HTML, SQL, C#,.NET, ASP.NET MVC безплатен курс "Разработка на софтуер в cloud среда" BG Coder - онлайн състезателна система - online judge курсове и уроци по програмиране, книги – безплатно от Наков безплатен курс "Качествен програмен код" алго академия – състезателно програмиране, състезания ASP.NET курс - уеб програмиране, бази данни, C#,.NET, ASP.NET курсове и уроци по програмиране – Телерик академия курс мобилни приложения с iPhone, Android, WP7, PhoneGap free C# book, безплатна книга C#, книга Java, книга C# Николай Костов - блог за програмиране http://csharpfundamentals.telerik.com
28
C# Programming @ Telerik Academy csharpfundamentals.telerik.com csharpfundamentals.telerik.com Telerik Software Academy academy.telerik.com academy.telerik.com Telerik Academy @ Facebook facebook.com/TelerikAcademy facebook.com/TelerikAcademy Telerik Software Academy Forums forums.academy.telerik.com forums.academy.telerik.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.