-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] ContentViews and Grids not rendered properly in right-to-left cultures #15095
Comments
Just did more testing and seems Grid inside another Grid will also cause the inner Grid to not render, I have updated the title and repro project to reflect this discovery |
One workaround that might work for now (not sure if it will cover all your scenarios) is to set the <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:str="clr-namespace:MauiArabic.Resources.Strings"
x:Class="MauiArabic.MainPage"
xmlns:local="clr-namespace:Microsoft.Maui.Controls;assembly=Microsoft.Maui.Controls">
...
<ContentView Background="Green" BackgroundColor="Green" FlowDirection="LeftToRight">
<Border StrokeThickness="5" Stroke="Red"
FlowDirection="{Binding Source={x:Static local:Device.FlowDirection}}">
<Border.StrokeShape>
<RoundRectangle CornerRadius="5" />
</Border.StrokeShape>
<Grid BackgroundColor="Blue" HeightRequest="40">
<Label Text="Control in a ContentView" TextColor="White"/>
</Grid>
</Border>
</ContentView> Once I have a better idea of the root cause I'll see if there's a more complete workaround. |
Is this issue going to close? Or remain open until further investigation? |
We're going to fix it before we close it. |
Setting the FlowDirection at page level works on elements declared directly on that page. However, elements inside of a ContentView are still not displayed if the FlowDirection is set to RightToLeft. |
* Avoid negative X position values when arranging for RTL Fixes #15095 * Add automated test * Auto-format source code --------- Co-authored-by: E.Z. Hart <hartez@gmail.com> Co-authored-by: GitHub Actions Autoformatter <autoformat@example.com>
Thanks for the workaround @PureWeen and @hartez , I was able to get the repro project to show up but issue still persists inside our app, digging into it more it seems that ContentTemplates would still not show contents through ContentPresenter, should we reopen this issue or do you want me to create a new one? |
Unfortunately we haven't found a cross cutting way to apply EZ's fix. I did whip this up which looks like it works with your sample Related extension method here If you want to give that a go that should help our confidence level out with backporting vs not |
* Avoid negative X position values when arranging for RTL Fixes #15095 * Add automated test * Auto-format source code --------- Co-authored-by: E.Z. Hart <hartez@gmail.com> Co-authored-by: GitHub Actions Autoformatter <autoformat@example.com>
hey @PureWeen, I was able to test your workaround in our app which works great in about 99% scenarios, some exceptions I have found including ActivityIndicator and SKLottieView from SkiaSharp.Extended.UI, they have the correct position as can be seen by setting a background color, but they are drawn at left hand side, do you think your handler fix would apply to those? Thank you. Edit: I have updated the repro project to include the activity indicator repro, SKLottieView seems to be working with a custom handler but ActivityIndicator still has the wrong x position when WidthRequest and HeightRequest is set. |
|
Description
On iOS when Arabic is defined as one of the CFBundleLocalizations in Info.plist it will force the app into right-to-left layout mode. Under such circumstance, ContentViews (and potentially other views, still triaging atm) do not render past first immediate child view, as in, if I have the following xaml defined, only the border is rendered, the grid and the label are not rendered.
Steps to Reproduce
Note: the resx files in the repro project does not seem to affect anything and can be omitted
<dict>
section<VerticalStackLayout>
Link to public reproduction project repository
https://github.com/dk-mushiyoke/MauiContentViewRtlRepro
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 16
Did you find any workaround?
Instead of using ContentView or Grid try Vertical/HorizontalStackLayout
#15095 (comment)
Relevant log output
The text was updated successfully, but these errors were encountered: