You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think you have to insert refresh control as a subview.
It has been already a property of UITableView, UICollectionView and UIScrollView.
So even TryOffSetRefresh method is not required if I make this change.
protected bool TryInsertRefresh(UIView view) {
// Save the refresh control parent.
refreshControlParent = view;
if (view is UITableView) {
var uiTableView = view as UITableView;
uiTableView = view as UITableView;
uiTableView.RefreshControl = refreshControl;
return true;
}
if (view is UICollectionView) {
var uiCollectionView = view as UICollectionView;
uiCollectionView = view as UICollectionView;
uiCollectionView.RefreshControl = refreshControl;
return true;
}
if (view is UIWebView) {
var uiWebView = view as UIWebView;
uiWebView.ScrollView.RefreshControl = refreshControl;
return true;
}
if (view is UIScrollView) {
var uiScrollView = view as UIScrollView;
uiScrollView.RefreshControl = refreshControl;
uiScrollView.AlwaysBounceVertical = true;
return true;
}
if (view.Subviews == null) return false;
for (int i = 0; i < view.Subviews.Length; i++) {
var control = view.Subviews[i];
if (TryInsertRefresh(control)) return true;
}
return false;
}
public bool IsRefreshing {
get => _isRefreshing;
set {
_isRefreshing = value;
if (_isRefreshing) {
refreshControl.BeginRefreshing();
}
else {
refreshControl.EndRefreshing();
}
}
}
private bool _isRefreshing;
The text was updated successfully, but these errors were encountered:
I don't think you have to insert refresh control as a subview.
It has been already a property of UITableView, UICollectionView and UIScrollView.
So even TryOffSetRefresh method is not required if I make this change.
The text was updated successfully, but these errors were encountered: