{"id":31000,"date":"2017-04-13T13:00:56","date_gmt":"2017-04-13T20:00:56","guid":{"rendered":"https:\/\/blog.xamarin.com\/?p=31000"},"modified":"2017-04-13T13:00:56","modified_gmt":"2017-04-13T20:00:56","slug":"make-xamarin-forms-apps-even-better-faster","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/xamarin\/make-xamarin-forms-apps-even-better-faster\/","title":{"rendered":"Make Your Xamarin.Forms Apps Even Better (and Faster!)"},"content":{"rendered":"<p>\t\t\t\tAs we continue to pursue the best in stability and performance, we&#8217;re excited to get your feedback on our first pre-release of Xamarin.Forms 2.3.5. Boasting over 130 fixes and enhancements this release, I&#8217;d like to highlight a few that we&#8217;re most eager for you to explore: Fast Renderers, ListView enhancements, and macOS preview!<\/p>\n<h3>Fast Renderers for Android<\/h3>\n<p>The concept behind Fast Renderers is fairly simple: reduce inflation and rendering costs by flattening the control nesting. Simple almost always performs better! We&#8217;re delivering Button, Image, and Label in this first batch of optimized renderers. To use it, do nothing; they&#8217;re on by default in this pre-release.<\/p>\n<p>Our initial testing teases upwards of 2x speed improvement to render a view with these controls. Large ListView scrolling with cells of these controls was visibly smoother and recovered much faster when aggressively scrolling thousands of rows. What&#8217;s clear, and is no real surprise, is that hardware, OS version, and the complexity of the view are significant factors in how greatly this will impact your results.<\/p>\n<p>Join our <a href=\"https:\/\/forums.xamarin.com\/93178\/lets-talk-performance\/p1\">performance discussion in the forums<\/a> and let us know your results. We&#8217;re also asking for XAML layout contributions to build up our performance test suite. We\u2019d love your participation!<\/p>\n<p>We have more work to do performing this refactoring on the remaining controls for Android and iOS, but we&#8217;re excited to share what we have so far.<\/p>\n<h3>ListView Enhancements<\/h3>\n<p>We continue to chip away at improving list performance. Fast Scroll on Android is now enabled by default and may be set using a Platform Specific.<\/p>\n<pre class=\"lang:c# decode:true\">listView.On&lt;Android&gt;().SetIsFastScrollEnabled(true);<\/pre>\n<p>If you\u2019re using a shared project like I am and have a namespace collision with <code>Android<\/code>, this is a clean way to address that:<\/p>\n<pre class=\"lang:c# decode:true \">using Platform = Xamarin.Forms.PlatformConfiguration;\n...\nlistView.On&lt;Platform::Android&gt;().SetIsFastScrollEnabled(true);\n<\/pre>\n<p>And with FastScrollEnabled you can now use Section Indexes.<\/p>\n<p>Android isn\u2019t the only beneficiary of ListView love. iOS and UWP get over a dozen updates and fixes to address performance, recycling, and reported memory leaks.<\/p>\n<h3>macOS Preview<\/h3>\n<p>We know many have been following our macOS backend for Xamarin.Forms progress and building from that public branch. Today, we hope everyone will give this preview a run and provide your feedback. Here are the basics of what you need to get started:<\/p>\n<ol>\n<li>Add a Mac Cocoa App project to your Xamarin.Forms solution and set it as your Startup Project<\/li>\n<li>Add a project reference to your shared project or PCL<\/li>\n<li>Import any platform specific resources such as images or fonts<\/li>\n<li>Add this pre-release NuGet to all projects and PCLs<\/li>\n<li>Update the AppDelegate.cs<\/li>\n<li>Run it!<\/li>\n<\/ol>\n<p>Here\u2019s a template <code>AppDelegate.cs<\/code> to give you a jump start:<\/p>\n<pre class=\"lang:c# decode:true \">\n[Register(\"AppDelegate\")]\npublic class AppDelegate : FormsApplicationDelegate\n{\n\tNSWindow _window;\n\tpublic AppDelegate()\n\t{\n\t\tvar style = NSWindowStyle.Closable | NSWindowStyle.Resizable | NSWindowStyle.Titled;\n\n\t\tvar rect = new CoreGraphics.CGRect(200, 1000, 1024, 768);\n\t\t_window = new NSWindow(rect, style, NSBackingStore.Buffered, false);\n\t\t_window.Title = \"Xamarin.Forms Mac\";\n\t\t_window.TitleVisibility = NSWindowTitleVisibility.Hidden;\n\t}\n\n\tpublic override NSWindow MainWindow\n\t{\n\t\tget { return _window; }\n\t}\n\n\tpublic override void DidFinishLaunching(NSNotification notification)\n\t{\n\t\tForms.Init();\n\t\tLoadApplication(new App());\n\n\t\tbase.DidFinishLaunching(notification);\n\t}\n}\n<\/pre>\n<h2>Try It Today!<\/h2>\n<p>To get <a href=\"https:\/\/www.nuget.org\/packages\/Xamarin.Forms\/2.3.5.233-pre1\" target=\"_blank\">Xamarin.Forms 2.3.5.233-pre1<\/a>, search your NuGet package manager with the pre-release option enabled, and install it into each PCL and App project.<\/p>\n<p>Be sure to check the full <a href=\"https:\/\/releases.xamarin.com\/pre-release-xamarin-forms-2-3-5-233\/\" target=\"_blank\">release notes<\/a>, and to see what else is in the Xamarin.Forms pipeline visit the <a href=\"https:\/\/forums.xamarin.com\/85747\/xamarin-forms-feature-roadmap\/p1\" target=\"_blank\">public roadmap<\/a>.<\/p>\n<p>If you have a bug to report, drop us a detailed <a href=\"https:\/\/bugzilla.xamarin.com\/enter_bug.cgi?product=Forms&amp;target_milestone=---\" target=\"_blank\">report here<\/a> so we can investigate.<\/p>\n<p><em><a href=\"https:\/\/forums.xamarin.com\/93181\/pre-release-xamarin-forms-2-3-5-233-pre1\/p1\" target=\"_blank\">Discuss this post on the Xamarin Forums<\/a><\/em>\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As we continue to pursue the best in stability and performance, we&#8217;re excited to get your feedback on our first pre-release of Xamarin.Forms 2.3.5. Boasting over 130 fixes and enhancements this release, I&#8217;d like to highlight a few that we&#8217;re most eager for you to explore: Fast Renderers, ListView enhancements, and macOS preview! Fast Renderers [&hellip;]<\/p>\n","protected":false},"author":553,"featured_media":39167,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[16],"class_list":["post-31000","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developers","tag-xamarin-forms"],"acf":[],"blog_post_summary":"<p>As we continue to pursue the best in stability and performance, we&#8217;re excited to get your feedback on our first pre-release of Xamarin.Forms 2.3.5. Boasting over 130 fixes and enhancements this release, I&#8217;d like to highlight a few that we&#8217;re most eager for you to explore: Fast Renderers, ListView enhancements, and macOS preview! Fast Renderers [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/31000","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/users\/553"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/comments?post=31000"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/31000\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media\/39167"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media?parent=31000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/categories?post=31000"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/tags?post=31000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}