Learn how to build a native iOS renderer for your control and export it to make it available to Xamarin.Forms.
- [Instructor] To create the iOS renderer,…we'll go into our iOS application here,…add a new folder called Controls…and to that we'll add a new class.…We'll call that NumberEntryRenderer.…And we're gonna again derive from the EntryRenderer.…In this case, if we look and find that,…it's gonna be in the Xamarin.Forms.Platform.iOS…so we're deriving from the existing iOS renderer…that renders those entry fields.…
We'll override the OnElementChanged,…let the base do it's thing,…and then we'll make sure that the Control…the base class has created exists.…And if the Control's not null,…then we can change the KeyboardType…to be a UIKit.KeyboardType.NumberPad.…A very similar concept to what we did…in the Android application.…Now again, we need to make sure…that Xamarin knows about this renderer…so we're gonna use the Xamarin.Forms.…
ExportRenderer attribute here.…We got two types.…First one is our Control,…so that's the Controls.NumberEntry,…and then the second one is our Renderer,…so we've got typeof and now it's HPlusSports.iOS.Controls.…
- 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.