Skip to content
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] Border`s Render was not correctly in CollectionView #23620

Closed
maonaoda opened this issue Jul 16, 2024 · 8 comments
Closed

[iOS] Border`s Render was not correctly in CollectionView #23620

maonaoda opened this issue Jul 16, 2024 · 8 comments
Labels
area-controls-border Border platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@maonaoda
Copy link
Contributor

maonaoda commented Jul 16, 2024

Description

Border`s Render was not correctly in CollectionView.
For the size rendering, it was unexpectedly displayed.

2024-07-16.13.03.00.mov

Steps to Reproduce

https://github.com/maonaoda/MauiBugs

Link to public reproduction project repository

No response

Version with bug

8.0.70 SR7

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@maonaoda maonaoda added the t/bug Something isn't working label Jul 16, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@maonaoda
Copy link
Contributor Author

Put the Border into Grid could fix this.
I believe the problem still exists, but it won't appear 100% of the time. :(

change this

                        <Border IsVisible="{Binding IsFinished}"
                                Grid.Row="1"
                                Grid.RowSpan="2"
                                Grid.Column="2"
                                Padding="5, 2"
                                BackgroundColor="#0098A5"
                                MaximumHeightRequest="30"
                                StrokeShape="{RoundRectangle CornerRadius='2'}"
                                StrokeThickness="0"
                                Margin="0, 2, 0, 0"
                                HorizontalOptions="End"
                                VerticalOptions="Start">
                            <Grid RowDefinitions="*"
                                  ColumnDefinitions="*">
                                <Label Grid.Row="0"
                                       Grid.Column="0"
                                       Text="解決"
                                       TextColor="#FFFFFF"
                                       FontSize="12"
                                       FontAttributes="Bold"
                                       HorizontalTextAlignment="Center"/>
                            </Grid>
                        </Border>

to

                        <Grid IsVisible="{Binding IsFinished}"
                              RowDefinitions="auto"
                              ColumnDefinitions="auto"
                              Grid.Row="1"
                              Grid.RowSpan="2"
                              Grid.Column="2">
                            <Border Grid.Row="0"
                                    Grid.Column="0"
                                    Padding="5, 2"
                                    BackgroundColor="#0098A5"
                                    MaximumHeightRequest="30"
                                    StrokeShape="{RoundRectangle CornerRadius='2'}"
                                    StrokeThickness="0"
                                    Margin="0, 2, 0, 0"
                                    HorizontalOptions="End"
                                    VerticalOptions="Start">
                                <Grid RowDefinitions="*"
                                      ColumnDefinitions="*">
                                    <Label Grid.Row="0"
                                           Grid.Column="0"
                                           Text="解決"
                                           TextColor="#FFFFFF"
                                           FontSize="12"
                                           FontAttributes="Bold"
                                           HorizontalTextAlignment="Center"/>
                                </Grid>
                            </Border>
                        </Grid>

@RoiChen001 RoiChen001 added s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage labels Jul 16, 2024
@RoiChen001
Copy link

I can repro this issue at iOS platform on the latest 17.11.0 Preview 3.0 (8.0.61&8.0.70).

@acaliaro
Copy link

I believe that Border management in a CollectionView is currently one of the biggest problems in building a UI in MAUI

@maonaoda
Copy link
Contributor Author

#23156 not working for this.

@maonaoda
Copy link
Contributor Author

#18204 (comment) could fix this.

@maonaoda
Copy link
Contributor Author

maonaoda commented Jul 16, 2024

Slightly modify this to temporarily replace all PlatformView creation methods of BorderHandler.

#if IOS
  BorderHandler.PlatformViewFactory = (h) => new NoneAnimatedBorderContentView() { CrossPlatformLayout = h.VirtualView };
#endif

#if IOS
        class NoneAnimatedBorderContentView : Microsoft.Maui.Platform.ContentView
        {
            public override void LayoutSubviews()
            {

                Layer.RemoveAllAnimations();

                if (Layer.Sublayers != null)
                {

                    for (var i = 0; i < Layer.Sublayers.Length; i++)
                    {
                        Layer.Sublayers[i].RemoveAllAnimations();
                    }
                }

                base.LayoutSubviews();
            }
        }
#endif

@jsuarezruiz
Copy link
Contributor

This issue have been fixed by #24360

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-border Border platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants