Learn how to use the OnIdiom class to change the layout scaling for a grid view when displayed on table, desktop, and phone.
- [Instructor] Another case that you may need…to account for…in building your cross-platform application,…is different form factors,…or as they're called in XAML, idioms.…When we think about tablets versus phones versus desktop,…we're thinking about different sizes of screens.…If we look back at our columns and our grid…for our order form,…you remember that we define the width…of that middle column as two times the width…of the other columns.…So we have these factors.…
And that worked okay for our phone.…When we think about a tablet or a desktop,…we may wanna change that.…So I'm gonna change this column definition.…And I'm gonna now add the ColumnDefinition.Width…as a property in there.…And here, just like I used the OnPlatform,…I can use the OnIdiom…and I can use the x type arguments.…And here, this I know is going to be a GridLength.…And you can see the options pop up for me…to choose desktop, phone, tablet,…and even TV.…
So for desktop, let's make this six times,…and for tablet, we'll make it four times,…and then back to phone, we'll do two times.…
- Creating a Xamarin.Forms solution
- Navigating between pages
- Screen layouts and controls in Xamarin.Forms
- Data binding
- Adding style to a control
- Using a Xamarin.Essentials package
- Embedding native controls in your shared forms
- Writing custom renderers
Skill Level Beginner
Xamarin Development: Authentication and Identitywith Matt Milner1h 32m Intermediate
What you should know1m 21s
2. Layout and Controls
3. Native Platform Integration
4. Native Controls and Renderers
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.