Xamarin.Forms 4.0.0.135214-pre4 (4.0.0 Pre Release 4) Release Notes

Getting Started | What's New | Known Issues | Breaking Changes | API Changes | Blogs | Feedback | Open Source

Xamarin.Forms 4.0.0 is a substantial release with several big new features. As such, we are releasing much earlier than usual to get more feedback not only on the quality of the release, but on the use of the features while we are still developing them.

While we work on 4.0.0, we will continue releasing quality improvements and minor enhancements via the 3.x series approximately every 6 weeks.

To get started with Xamarin.Forms 4.0 enable all the new features in your MainActivity.cs and AppDelegate.cs via the feature flags api:

global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "Visual_Experimental", "CollectionView_Experimental");
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

Here's what you have to look forward to:

Shell

Shell introduces a simplified way to express the structure and navigation for your application in a single file. No more dealing with different page types to handle setting up complicated navigation. It supports flyout menu, bottom tabs, top tabs, and an integrated search handler. A new URI based navigation routing system has been implemented in addition to the existing push/pop navigation service. Now you can route to any point in your application, no matter how deep, and handle navigation events to perform custom logic such as canceling the back action.

To get started, add a new ContentPage with XAML to your project and modify the code below to match your namespace:

<?xml version="1.0" encoding="UTF-8"?>
<Shell xmlns="http://xamarin.com/schemas/2014/forms" 
       xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
       xmlns:local="clr-namespace:NewApp"
       RouteHost="companyname.com"
       RouteScheme="app"
       Route="NewApp"
       FlyoutBehavior="Disabled"
       Title="NewApp"
       x:Class="NewApp.AppShell">

    <!-- 
        Styles and Resources 
    -->
    <Shell.Resources>
        <ResourceDictionary>
            <Color x:Key="NavigationPrimary">#2196F3</Color>
            <Style x:Key="BaseStyle" TargetType="Element">
                <Setter Property="Shell.ShellBackgroundColor" Value="{StaticResource NavigationPrimary}" />
                <Setter Property="Shell.ShellForegroundColor" Value="White" />
                <Setter Property="Shell.ShellTitleColor" Value="White" />
                <Setter Property="Shell.ShellDisabledColor" Value="#B4FFFFFF" />
                <Setter Property="Shell.ShellUnselectedColor" Value="#95FFFFFF" />
                <Setter Property="Shell.ShellTabBarBackgroundColor" Value="{StaticResource NavigationPrimary}" />
                <Setter Property="Shell.ShellTabBarForegroundColor" Value="White"/>
                <Setter Property="Shell.ShellTabBarUnselectedColor" Value="#95FFFFFF"/>
                <Setter Property="Shell.ShellTabBarTitleColor" Value="White"/>
            </Style>
            <Style TargetType="ShellItem" BasedOn="{StaticResource BaseStyle}" />
        </ResourceDictionary>
    </Shell.Resources>

    <!-- Your Pages -->
    <ShellItem>
        <ShellContent>
            <local:MainPage/>
        </ShellContent>
    </ShellItem>

</Shell>

Then set this AppShell class as your main page in the App.xaml.cs file:

namespace NewApp
{
    public partial class App : Application
    {
        public App ()
        {
            InitializeComponent();

            MainPage = new AppShell();
        }
    }
}

For more information about Shell check out the preview doc and view the Tailwind Traders mobile reference app. If you're evaluating Visual Studio 2019 on Windows, we've created a set of Shell templates for you. Download and install the package here.

Visual

Visual is a new way to achieve consistent UI design across iOS and Android, beginning with an implementation of Google's Material Design. This first iteration include Button, Entry, Frame, and ProgressBar. Visual goes beyond styles to also unify behavior and when necessary providing highly customize renderers.

Xamarin.Forms Visual on Android and iOS

For more information about Visual, check out the preview doc.

CollectionView and CarouselView

CollectionView is the flexible and performant list control that you've been asking for. It can handle horizontal, vertical, and grid layouts out of the box, and you can provide custom layouts as well. CollectionView is also the foundation for CarouselView.

For more information about CollectionView, check out the preview doc.

Tip

There are lots of new features planned for Xamarin.Forms 4.0 – check out what's new below.

What's New in this Release

  • "[Enhancement] Added GroupHeaderStyle property for iOS specific ListView class" (#4616) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

  • Github #1450 - "[Enhancement] Add drag started and completed events/commands to Slider" (#4423) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

  • Github #1522 - "[UWP] Extension methods for Color ToWindowsColor() and ToBrush() not accessible" (#4558) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

  • Github #1678 - "[Enhancement] Entry: Read-only entry" (#1972) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

  • Github #1708 - "[Enhancement] PinsSource on Forms.Map" (#4269) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

  • Github #2756 - "[Xaml] parsing too permissive" (#4723) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

  • Github #2811 - "ListView should report index of item on all events" (#4431) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

  • Github #2902 - "Change SearchBar base class to InputView" (#3248) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

  • Github #3167 - "Proposal: Change default binding mode of Span Text property to OneWay" (#4850) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

  • Github #3189 - "Xamarin.Forms.FontIconSource Spec" (#4747) (#4817) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

  • Github #3191 - "Expose XmlnsDefinitionAttribute and XmlnsPrefixAttribute" (#4562) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

  • Github #4199 - "[iOS] Add ability to turn off animations in ListView during data load" (#4709) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

  • Github #4460 - "[UWP] Switch color is not set" (#4883) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

  • Github #4669 - "Color for picker title" (#4701) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

Notable Changes

  • Github #1678 - "[Enhancement] Entry: Read-only entry" (#1972) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #1708 - "[Enhancement] PinsSource on Forms.Map" (#4269) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #4834 - "[MacOS] Readonly setting on macos only takes hold once field loses first responder" (#1972) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

Features in Preview

Shell

  • "[Android] If drawable specified on shell doesn't exist don't dispose of it" (#4904) (added in 4.0.0.94569-pre3 (4.0.0 Pre Release 3))
  • "[Shell][iOS] do not try to smartly unblend bgcolor" (#4593) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • Github #4382 - "[Shell] Crash when switching Bottom Navigation Tabs too fast" (#4617) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • Github #4592 - "[Shell] compile the DataTemplateExtension" (#4641) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • Github #4625 - "[Shell] statically expose the current shell" (#4626) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • Github #4837 - "[Shell] Cannot pass querystring value to registered route" (#4843) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • Github #4971 - "[Shell] Cannot navigate to a relative URI" (#4977) (added in 4.0.0.94569-pre3 (4.0.0 Pre Release 3))

CollectionView

  • "[iOS] Fix ScrollTo MakeVisible positioning" (#5063) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • "CollectionView Android Remove Multiple" (#4869) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • "CollectionView Android Single Item Selection" (#4651) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • "CollectionView iOS EmptyViewTemplate" (#4870) (added in 4.0.0.94569-pre3 (4.0.0 Pre Release 3))
  • "CollectionView iOS Move Item" (#4863) (added in 4.0.0.94569-pre3 (4.0.0 Pre Release 3))
  • "CollectionView iOS Replace Item" (#4865) (added in 4.0.0.94569-pre3 (4.0.0 Pre Release 3))
  • "CollectionView iOS Single Item Selection" (#4985) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • "CollectionView SnapPointsAlignment/SnapPointsType" (#4414) (added in 4.0.0.94569-pre3 (4.0.0 Pre Release 3))
  • Github #4406 - "[CollectionView, Android] Items using a Grid in their template do not fill the screen's width" (#4569) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • Github #4600 - "[iOS] CollectionView crash with empty ObservableCollection" (#4688) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))

Visual

  • "Material Design Renderers for the Material Visual" (#4733) (added in 4.0.0.94569-pre3 (4.0.0 Pre Release 3))
  • Github #4272 - "Xamarin.Forms Button ContentLayout property not working as expected" (#4449) (#4967) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #4354 - "Regression: Xamarin.Forms Button Image position broken on Android" (#4449) (#4967) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #4435 - "Spec: Visual" (#4449) (#4967) (#5026) (#5056) (#5088) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #4949 - "[Material] Filled Entry Spec" (#5056) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #4951 - "[Material] Contained Button Spec" (#4449) (#4967) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #5007 - "[Material] Circular Progress Indicator" (#5088) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #5020 - "[Material] Move Material renderers out of iOS default project " (#5026) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

Release History

  • Wednesday, February 6, 2019 - Xamarin.Forms 4.0.0.135214-pre4 (4.0.0 Pre Release 4)
  • Wednesday, January 23, 2019 - Xamarin.Forms 4.0.0.94569-pre3 (4.0.0 Pre Release 3)
  • Thursday, January 10, 2019 - Xamarin.Forms 4.0.0.62955-pre2 (4.0.0 Pre Release 2)
  • Monday, December 3, 2018 - Xamarin.Forms 4.0.0.8055-pre1 (4.0.0 Pre Release 1)

Wednesday, February 6, 2019 - Xamarin.Forms 4.0.0.135214-pre4 (4.0.0 Pre Release 4)

Issues Fixed

  • Github #1386 - "EntryCell within TableView using wrong keyboard" (#4377)
  • Github #1517 - "Runtime binding errors logged but not viewable" (#4539)
  • Github #2102 - "Empty NavigationPage throws NullReferenceException on UWP" (#3325)
  • Github #3193 - "Scroll View Visibility in Xaml or constructor not being honored" (#3195)
  • Github #3450 - "Transparent background for GroupItem in ListView does not work in iOS" (#4002)
  • Github #3647 - "Two keyboards appear when editing the TextColumn after the NumericColumn with Samsung Android version 6 devices only on Input type of Samsung Keyboard " (#4384)
  • Github #3873 - "[Core] LogWarningsToApplicationOutput doesn't work because Debug.* calls are stripped from forms release binary" (#4539)
  • Github #4097 - "(Android) Crash at Dependency service call " (#4157)
  • Github #4129/Bugzilla 59172 - "[iOS] Cleanup NavigationPage CurrentNavigationTask when an exception is thrown while popping a page" (#2873)
  • Github #4176 - "[Android] Java.Lang.RuntimeException: Animators may only be run on Looper threads on Battery Saver Mode" (#4177)
  • Github #4338 - "[macOS] BoxView binding to BackgroundColor broken" (#4958)
  • Github #4511 - "ImageButton CornerRadius doesn't work on iOS" (#4518)
  • Github #4653 - "IsTabStop property not working when Grid contains ScrollView" (#4703)
  • Github #4748 - "Setting SelectedItem property of GTK ListView does not reflected in UI" (#4757)
  • Github #4788 - "BoxView.BackgroundColor binding does not work on WPF" (#4959)
  • Github #4834 - "[MacOS] Readonly setting on macos only takes hold once field loses first responder" (#1972)
  • Github #4864 - "[Android] ObjectDisposedException in LabelRenderer" (#4878)
  • Github #4903 - "[UWP] SwitchCell in TableView disappears after toggling" (#4912)

Additional fixes included in this release

  • "[Android] Fix for ListViewRenderer causing ObjectDisposedException" (#4931)
  • "[Android] Only post DisableTimer to the queue if it's not on the UI thread" (#4866)
  • "[Core] Obsolete Vec2" (#4980)
  • "[Tizen] Supports Picker.TitleColor, FontSize, FontFamily and FontAttr" (#4839)
  • "[Tizen] Supports SwitchCell.OnColor" (#4785)
  • "[Tizen]Update style for Phone Idiom in ImageCell renderer" (#4610)
  • "[XamlC] Test generic parameters to evaluate equality of types" (#4062)
  • "Add Serializable on exception types" (#4690)

Wednesday, January 23, 2019 - Xamarin.Forms 4.0.0.94569-pre3 (4.0.0 Pre Release 3)

See Xamarin.Forms 3.5!

Thursday, January 10, 2019 - Xamarin.Forms 4.0.0.62955-pre2 (4.0.0 Pre Release 2)

See Xamarin.Forms 3.5!

Monday, December 3, 2018 - Xamarin.Forms 4.0.0.8055-pre1 (4.0.0 Pre Release 1)

See Xamarin.Forms 3.5!

Known Issues

  • Github #5041 - "Xamarin.Forms 4.0 Pre2 CollectionView.EmptyView cannot arrange content in center."
  • Github #5019 - "[iOS] CollectionView alignment when using Grid"
  • Github #4970 - "[Shell] Route navigation doesn't seem to work"
  • Github #4946 - "Tests in Issue3624 fails"
  • Github #4943 - "Issue4600.cs can't run"
  • Github #4872 - "[Shell] CSS is not working when referencing CSS-file in App.xaml"
  • Github #4856 - "App Crashes on nested Shell section"
  • Github #4845 - "[Shell] Back button behavior failures"
  • Github #4840 - "[Shell] ContentPage with UseSafeArea incorrectly renders"
  • Github #4767 - "[Shell] BackButtonBehavior is used to override the icon"
  • Github #4766 - "[Shell] Cannot set hamburger button asset"
  • Github #4762 - "[Shell] DisplayActionSheet "
  • Github #4755 - "[Shell] Control loses focus after appearing"
  • Github #4741 - "[Previewer] Errors running Previewer with 4.0 features"
  • Github #4684 - "Xamarin 4.0.0.8055-pre1 Shell Crashes when navigating too quickly"
  • Github #4683 - "Xamarin 4.0.0.8055-pre1 Shell doesn't load the Stylesheets on first presenting pages on Android."
  • Github #4664 - "[CollectionView] Fixes for ObservableCollection usage on Android"
  • Github #4663 - "[Shell] Android bottom drawer menu items throw exception on navigation"
  • Github #4658 - "[CollectionView, UWP] Updating items shows white rows"
  • Github #4399 - "[Shell] MenuItems outside of collection render differently"
  • Github #3875 - "[Shell] Flyout menu items should start below my header, no matter how tall"
  • Github #3864 - "[Shell] Adding ShellContent directly under ShellItem causes XAML editor warning in VS"
  • Github #3125 - "[Shell] Search bar on iOS is dark and black text is illegible"
  • Github #3124 - "[Shell] 3bar.png missing for the flyout menu hamburger"

Breaking Changes (as of pre4)

  • Github #2756 - "[Xaml] parsing too permissive" (#4723) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #2902 - "Change SearchBar base class to InputView" (#3248) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #3167 - "Proposal: Change default binding mode of Span Text property to OneWay" (#4850) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #4629 - "Picker/DatePicker/TimePicker on iOS iPad should NOT have word suggestions" (#4634) (added in 4.0.0.169046-pre5 (4.0.0 Pre Release 5))

Deprecations (as of pre4)

  • "[Core] Obsolete Vec2" (#4980) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #1517 - "Runtime binding errors logged but not viewable" (#4539) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #3873 - "[Core] LogWarningsToApplicationOutput doesn't work because Debug.* calls are stripped from forms release binary" (#4539) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

API Changes (as of pre4)

  • "[XamlC] Test generic parameters to evaluate equality of types" (#4062) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #1517 - "Runtime binding errors logged but not viewable" (#4539) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #1678 - "[Enhancement] Entry: Read-only entry" (#1972) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #2811 - "ListView should report index of item on all events" (#4431) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #2902 - "Change SearchBar base class to InputView" (#3248) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #3450 - "Transparent background for GroupItem in ListView does not work in iOS" (#4002) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #3873 - "[Core] LogWarningsToApplicationOutput doesn't work because Debug.* calls are stripped from forms release binary" (#4539) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #4097 - "(Android) Crash at Dependency service call " (#4157) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))
  • Github #4834 - "[MacOS] Readonly setting on macos only takes hold once field loses first responder" (#1972) (added in 4.0.0.135214-pre4 (4.0.0 Pre Release 4))

Blogs

blog.xamarin.com

Feedback

Your feedback is important to us. If there are any problems with this release, check the Xamarin.Forms Forums and GitHub for existing issues. Report new issues and suggestions on GitHub.

Open Source

Xamarin.Forms 4.0.0 is based on the open-source Xamarin.Forms repository: