--- /dev/null
+using Xamarin.Forms.CustomAttributes;
+using Xamarin.Forms.Internals;
+
+namespace Xamarin.Forms.Controls.Issues
+{
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.Github, 5888, "[Bug] ListView HasUnevenRows is not working in iOS 10", PlatformAffected.iOS)]
+ public class Issue5888 : TestContentPage
+ {
+ protected override void Init()
+ {
+
+ var stack2 = new StackLayout
+ {
+ Children = { new Label { Text = "Hi" }, new Label { Text = "Bye" }, new Label { Text = "Open" } }
+ };
+ var listview = new ListView
+ {
+ HasUnevenRows = true,
+ ItemTemplate = new DataTemplate(() => new ViewCell { View = stack2 }),
+ ItemsSource = new string[] { "mono", "monodroid" }
+ };
+ Content = new StackLayout { Children = { listview } };
+ }
+ }
+}
\ No newline at end of file
if (_tableViewController != null)
_tableViewController.UpdateRefreshControlColor(color == Color.Default ? null : color.ToUIColor());
- }
+ }
void UpdateVerticalScrollBarVisibility()
{
protected override void UpdateEstimatedRowHeight(UITableView tableView)
{
- var estimatedRowheight = GetEstimatedRowHeight(tableView);
+ var estimatedRowHeight = GetEstimatedRowHeight(tableView);
//if we are providing 0 we are disabling EstimatedRowHeight,
//this works fine on newer versions, but iOS10 it will cause a crash so we leave the default value
- if (estimatedRowheight == 0 && Forms.IsiOS11OrNewer)
- tableView.EstimatedRowHeight = estimatedRowheight;
+ if (estimatedRowHeight > 0 || (estimatedRowHeight == 0 && Forms.IsiOS11OrNewer))
+ tableView.EstimatedRowHeight = estimatedRowHeight;
}
internal Cell GetPrototypicalCell(NSIndexPath indexPath)
{
UpdateShortNameListener();
- if(List.OnThisPlatform().RowAnimationsEnabled())
+ if (List.OnThisPlatform().RowAnimationsEnabled())
_uiTableView.ReloadData();
else
PerformWithoutAnimation(() => { _uiTableView.ReloadData(); });
public override void ViewWillAppear(bool animated)
{
(TableView?.Source as ListViewRenderer.ListViewDataSource)?.Cleanup();
- if (!_list.IsRefreshing || !_refresh.Refreshing) return;
+ if (!_list.IsRefreshing || !_refresh.Refreshing)
+ return;
// Restart the refreshing to get the animation to trigger
UpdateIsRefreshing(false);