On Xamarin.Forms (iOS Android), I need to change the loading-indicator position on the RefreshView. I need to add offset, so the indicator is visible if you have a bar overlapping the ScrollView-RefreshView combo and trigger pullOnRefresh.
Loading-indicator in the top edge
EDIT: thanks to Junior Jiang - MSFT- Android solution
I also implement a solution for xamarin.iOS
[assembly: ExportRenderer(typeof(RefreshView), typeof(CustomRefreshViewRenderer))]
namespace CustomRefresh.iOS {
public class CustomRefreshViewRenderer : RefreshViewRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<RefreshView> e)
{
base.OnElementChanged(e);
foreach (var nativeView in Subviews)
updateRefreshSettings(nativeView);
}
void updateRefreshSettings(UIView view) {
if (view is UIScrollView)
{
var scrollView = view as UIScrollView;
if (scrollView.RefreshControl != null)
{
var bounds = scrollView.RefreshControl.Bounds;
scrollView.RefreshControl.Bounds = new CGRect(bounds.X, -(100), bounds.Width, bounds.Height);
}
}
//add more scrollable view types
}
}
}