Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
When a ViewCell contains a ListView, for example in a hamburger menu which contains a list of recent projects as well as other menu commands, changing orientation will results in an unhanded exception.
- Create new project in VS2017 using Cross Platform App (Xamarin) template
- Select Blank App and Shared Project
- In MainPage.xaml, substitute the following Content:
<ImageCell ImageSource="Icon.png" Text="UserName" Detail="Email" />
<TableSection Title="Recent Projects">
Build and run Android project, then change orientation on device or emulator.
Result: Exception Unhandled (no call stack or exception details available because app is in break mode)
Populating ListView contents through binding in XAML or in codebehind doesn't seem to make a difference.
I am seeing a crash at launch on Android when using the provided XAML, whether there are items or not in the ListView: https://gist.github.com/jimmgarrido/77d5beee5242a7bb2586cfbc95e758f5
Even though this appears to work on iOS and UWP, having a ListView inside a ViewCell is not something we recommend or support so you may encounter further issues by doing this.
I would suggest using a ListView and DataTemplateSelector instead of a TableView. This way you can use a single ListView and still be able to provide a the list of recent items. Another approach might be to use a layout like StackLayout. When using this approach, avoid using a ScrollView if possible as there can be issues when using a ListView inside a ScrollView.
Hope this helps!