tiny fix
This commit is contained in:
@ -122,8 +122,9 @@ namespace Billing.UI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
var padding = Padding;
|
||||||
var spacing = Spacing;
|
var spacing = Spacing;
|
||||||
var lastHeight = 0d;
|
var lastHeight = padding.Top;
|
||||||
var rowHeight = RowHeight;
|
var rowHeight = RowHeight;
|
||||||
var groupHeight = GroupHeight;
|
var groupHeight = GroupHeight;
|
||||||
foreach (var item in Children)
|
foreach (var item in Children)
|
||||||
@ -154,7 +155,7 @@ namespace Billing.UI
|
|||||||
{
|
{
|
||||||
itemHeight = rowHeight;
|
itemHeight = rowHeight;
|
||||||
}
|
}
|
||||||
var rect = new Rectangle(0, lastHeight, width, itemHeight);
|
var rect = new Rectangle(padding.Left, lastHeight, width, itemHeight);
|
||||||
//item.Layout(rect);
|
//item.Layout(rect);
|
||||||
LayoutChildIntoBoundingRegion(item, rect);
|
LayoutChildIntoBoundingRegion(item, rect);
|
||||||
lastHeight += itemHeight + spacing;
|
lastHeight += itemHeight + spacing;
|
||||||
@ -185,7 +186,8 @@ namespace Billing.UI
|
|||||||
lastHeight += rowHeight + spacing;
|
lastHeight += rowHeight + spacing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lastSizeRequest = new SizeRequest(new Size(widthConstraint, lastHeight));
|
var padding = Padding;
|
||||||
|
lastSizeRequest = new SizeRequest(new Size(widthConstraint, lastHeight + padding.Top + padding.Bottom));
|
||||||
return lastSizeRequest;
|
return lastSizeRequest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,9 +75,9 @@
|
|||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Grid>
|
</Grid>
|
||||||
<!-- bill list -->
|
<!-- bill list -->
|
||||||
<ScrollView Grid.Row="2">
|
<ScrollView x:Name="scrollView" Grid.Row="2">
|
||||||
<ui:GroupStackLayout x:Name="billsLayout" ItemsSource="{Binding Bills}"
|
<ui:GroupStackLayout x:Name="billsLayout" ItemsSource="{Binding Bills}"
|
||||||
Margin="0, 10, 0, 0" RowHeight="50">
|
Padding="0, 10, 0, 0" RowHeight="50">
|
||||||
<ui:GroupStackLayout.ItemTemplate>
|
<ui:GroupStackLayout.ItemTemplate>
|
||||||
<DataTemplate x:DataType="v:UIBill">
|
<DataTemplate x:DataType="v:UIBill">
|
||||||
<ui:LongPressGrid Padding="20, 0" ColumnSpacing="10"
|
<ui:LongPressGrid Padding="20, 0" ColumnSpacing="10"
|
||||||
|
@ -5,6 +5,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Xamarin.Essentials;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
|
|
||||||
namespace Billing.Views
|
namespace Billing.Views
|
||||||
@ -43,6 +44,7 @@ namespace Billing.Views
|
|||||||
EditBilling = new Command(OnEditBilling);
|
EditBilling = new Command(OnEditBilling);
|
||||||
DeleteBilling = new Command(OnDeleteBilling);
|
DeleteBilling = new Command(OnDeleteBilling);
|
||||||
|
|
||||||
|
SelectedDate = DateTime.Now;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
billingDate.SetDateTime(DateTime.Now);
|
billingDate.SetDateTime(DateTime.Now);
|
||||||
@ -60,6 +62,7 @@ namespace Billing.Views
|
|||||||
b.CreateTime.Day == e.Date.Day);
|
b.CreateTime.Day == e.Date.Day);
|
||||||
Bills = new List<UIBill>(bills.Select(b => WrapBill(b)));
|
Bills = new List<UIBill>(bills.Select(b => WrapBill(b)));
|
||||||
RefreshBalance(Bills);
|
RefreshBalance(Bills);
|
||||||
|
MainThread.BeginInvokeOnMainThread(async () => await scrollView.ScrollToAsync(0, 0, true));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user