We have SfTabView with each tab hosting UITableView as child contents. We allow zooming in of UIImageView hosted inside of UIScrollView inside table cell. When user zooms in, image is properly zoomed, but the header of SfTabView clips the image, though we set 'Layer.ZPosition = 1000' of cell and image being zoomed, and though we set SfTabView's .ClipsToBounds = false.
What could be the cause?
Code:
void HandleZPositionInRecursions(UIView v)
{
if (v != null)
{
v.ClipsToBounds = false;
v.Layer.ZPosition = 1;
foreach (var child in v.Subviews)
{
if (child != null)
{
child.ClipsToBounds = false;
child.Layer.ZPosition = 1;
HandleZPositionInRecursions(child);
}
}
}
}
We explicitly set zooming image and scroll view to be at the top on zoom action:
imageScrollView.ViewForZoomingInScrollView += (UIScrollView sv) =>
{
UITableView tab = null;
this.Table.TryGetTarget(out tab);
tab.ScrollEnabled = false;
var parentView = sv.Superview;
while (parentView != null)
{
parentView = parentView.Superview;
if (parentView is SfTabView sfTabView)
{
HandleZPositionInRecursions(parentView);
}
}
this.Layer.ZPosition = 1000;
imageView.Layer.ZPosition = 1000;
sv.Layer.ZPosition = 1000;
this.Superview.Layer.ZPosition = 100;
tab.ClipsToBounds = false;
tab.SeparatorStyle = UITableViewCellSeparatorStyle.None;
imageScrollView.ContentSize = new CGSize(imageView.Frame.Width, imageView.Frame.Height);
return imageView;
};