Sunday, May 12, 2024
HomeiOS Development.internet - How do I make an inventory merchandise the complete top...

.internet – How do I make an inventory merchandise the complete top of it is content material in IOS? (utilizing a grid “*” row appears to be damaged in IOS)


I’ve an inventory merchandise in .internet MAUI for IOS that’s not working as anticipated. It seems that the problems lie in the truth that the grid visible components inside every particular person merchandise within the assortment view usually are not increasing to the complete top of the checklist merchandise’s content material when their grid rows are set to have a grid row top of “*” after being made seen by a boolean. The code under demonstrates the problem that I’m having:

Right here is the xaml code Discover how I attempted to even give the mother or father components a hard and fast top from the gathering view that should increase to the peak of the mother or father assortment view’s 10000 unit top:

    <ContentPage.Content material>
<Grid RowDefinitions="10000" BackgroundColor="BlanchedAlmond">
....
    <VerticalStackLayout Grid.Row="0" Grid.Column="0" BackgroundColor="Aquamarine">
        <VerticalStackLayout IsVisible="{Binding ShowBusyOverlay, Converter={StaticResource not}}" HeightRequest="10000">
<CollectionView x:Identify="sessionSummaryList" ItemsSource="{Binding DataSections}" HeightRequest="10000">
    <CollectionView.ItemTemplate>
        <DataTemplate x:DataType="datacollection:DataSection">
            <Grid>
                <!--Right here is the place the problem lies with the grid star "*" top within the assortment view checklist item-->
                <Grid.RowDefinitions>
                    <RowDefinition Peak="40"/>
                    <RowDefinition Peak="10"/>
                    <RowDefinition Peak="*"/>
                </Grid.RowDefinitions>
                <HorizontalStackLayout Margin="10, 5" Grid.Row="0" Grid.Column="0">
                    <HorizontalStackLayout.GestureRecognizers>
                        <TapGestureRecognizer Command="{Binding BindingContext.SectionTapped, Supply={x:Reference Kind} }" CommandParameter="{Binding .}" />
                    </HorizontalStackLayout.GestureRecognizers>
                    <Label Textual content="{Binding Title}" Model="{StaticResource label}" MinimumHeightRequest="40" VerticalTextAlignment="Heart" TextColor="{StaticResource normalText}" FontAttributes="Daring" />
                    <Picture  Supply="{Binding Expanded, Converter={StaticResource expandedImageConverter}}" HorizontalOptions="Finish" HeightRequest="20" WidthRequest="20" Side="AspectFit" />
                </HorizontalStackLayout>
                <BoxView Grid.Row="1" Grid.Column="0" Shade="#b9b9b9"/>
                <!--That is the place the growth boolean is that I discussed earlier "{Binding Expanded}"-->
                <CollectionView Grid.Row="2" Grid.Column="0" IsVisible="{Binding Expanded}" ItemsSource="{Binding SectionItems}" ItemTemplate="{StaticResource SectionSelector}" EmptyView="No gadgets to show" BackgroundColor="White"/>
            </Grid>
        </DataTemplate>
    </CollectionView.ItemTemplate>
</CollectionView>
....
</VerticalStackLayout>
....
</VerticalStackLayout>
....
</Grid>
.......
</ContentPage>

Right here is the present template of the “part selector”

Right here is the c# view mannequin growth technique tied to the Binding “Expanded” boolean talked about earlier within the code behind:

public ICommand SectionTapped => new Command<SessionSummarySection>(OnSectionTapped);
//......
personal void OnSectionTapped(SessionSummarySection sessionSummarySection)
{
    sessionSummarySection.Expanded = !sessionSummarySection.Expanded;

}

I even have an hooked up picture of what the anticipated habits needs to be please confer with that for extra particulars on how this code ought to work:

enter picture description right here

As you’ll be able to see, I’ve tried to get the structure to behave by setting the mother or father UI components with a hard and fast top in order that the grid can fill and increase in every merchandise within the assortment view in response to the gathering view’s mother or father, however to no avail.

The one different method that I can consider to get this to work is by manually setting the peak of every grid in every assortment view ingredient with exhausting values and never values like “6*” or “*” however that may imply I must add up the peak of the content material of every checklist merchandise by grabbing the precise visible ingredient tree from every grid with an x:Identify reference or one thing like that (which I don’t know find out how to do). If anybody is aware of one other method or can please present me find out how to get this to work that may be nice.

Facet notes, if I let the web page re-render by way of sizzling reload, it should all of a sudden work for some motive, which suggests this can be a MAUI-specific bug (I feel). One other factor to notice is that this resolution must be cross platform with not solely IOS, however android as nicely. So once more, any recommendation on find out how to repair this subject could be very useful certainly. Additionally, in the event you do not thoughts explicitly letting me know if the answer is free for me to make use of for a industrial venture, let me know in order that I can attribute you accordingly. Thanks! (If not, I’ll put my very own spin on it, simply to be secure.)



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments