CollectionView EmptyView in arabic on IOS is mirrored
Steps to Reproduce
<CollectionView ItemsSource="{Binding Path=BindingContext.ReceivedReminders, Source={x:ReferenceName=DashBoardView}}"
EmptyView="賲丕 賲賳 亘賳賵丿 賲賲賰賳 毓乇囟賴丕">
....
</CollectionView>
Screenshots
A work around is to create an iOS renderer as follow:
`
[assembly: ExportRenderer(typeof(CollectionView), typeof(CustomCollectionViewRenderer))]
namespace MyApp.iOS.Renderers
{
class CustomCollectionViewRenderer : CollectionViewRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<GroupableItemsView> e)
{
base.OnElementChanged(e);
if (Control.PreferredFocusEnvironments[0] is UICollectionView collectionView)
{
CollectionView cv = (CollectionView)e.NewElement;
UICollectionView control = (UICollectionView)Control.PreferredFocusEnvironments[0];
if (control.EffectiveUserInterfaceLayoutDirection == UIUserInterfaceLayoutDirection.RightToLeft)
{
if (cv.EmptyView != null && cv.EmptyView is VisualElement)
{
var emptyView = (VisualElement)cv.EmptyView;
emptyView.ScaleX = -1;
emptyView.ScaleY = 1;
}
else if (cv.EmptyView is string)
{
cv.EmptyView = new Label()
{
Text = (string)cv.EmptyView,
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.Center,
HorizontalTextAlignment = TextAlignment.Center,
VerticalTextAlignment = TextAlignment.Center,
ScaleX = -1,
ScaleY = 1
};
}
}
}
}
}
}
`
Another workaround purely using xaml EmptyView data template, I just don't like CustomRenderers ;)
Another workaround purely using xaml EmptyView data template, I just don't like CustomRenderers ;)
Nice workaround I liked it
collectionview.header has the same problem
Most helpful comment
Another workaround purely using xaml EmptyView data template, I just don't like CustomRenderers ;)