English 中文(简体)
收文中为什么有不同的盒子?
原标题:Why are the Check Boxes in the CollectionView differently sized?

我无法找到解决奇怪行为的办法。 NET MAUI。

我利用收集的观点来描述对一个问题的答复数量不一。 每次回答之前都要有一个检查箱。 然而,检查箱似乎并不一致,规模也不相同。 请比较:

“Check

周围收集情况的背景是彩色的“阿夸”,而检查箱的背景为图示目的的颜色“黄色”。

这一点在相应的《观点法典》中显而易见:

<CollectionView Grid.Row="2"
                Grid.Column="0"
                ItemsSource="{Binding CurrentAnswers}"
                ItemsLayout="VerticalGrid"
                ItemSizingStrategy="MeasureAllItems"
                VerticalScrollBarVisibility="Always"
                HeightRequest="400">
    <CollectionView.ItemTemplate>
        <DataTemplate>
            <Grid x:DataType="models:Answer"
                  Padding="20"
                  BackgroundColor="Aqua">
                <Grid.RowDefinitions>
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <RadioButton Grid.Row="0"
                             Grid.Column="0"
                             Content="{x:Binding Content}"
                             TextColor="{StaticResource NightBlue}"
                             GroupName="Answers"
                             IsVisible="{Binding 
                        Path=BindingContext.CurrentQuestion.QuestionType,
                        Converter={StaticResource QuestionTypeIsStandardToBooleanConverter}, 
                        Source={x:Reference refTestView}}" />
                <Grid Grid.Row="0"
                      Grid.Column="0"
                      IsVisible="{Binding 
                        Path=BindingContext.CurrentQuestion.QuestionType,
                        Converter={StaticResource QuestionTypeIsMultipleChoiceToBooleanConverter}, 
                        Source={x:Reference refTestView}}">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="100" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <CheckBox Grid.Row="0"
                              Grid.Column="0"
                              BackgroundColor="Yellow"
                              Color="{StaticResource AlpineBlue}" />
                    <Label Grid.Row="0"
                           Grid.Column="1"
                           Text="{Binding Content}"
                           TextColor="{StaticResource NightBlue}"
                           VerticalOptions="Center"
                           LineBreakMode="WordWrap" />
                </Grid>


                <Entry Grid.Row="0"
                       Grid.Column="0"
                       IsSpellCheckEnabled="False"
                       IsTextPredictionEnabled="False"
                       HorizontalOptions="Start"
                       WidthRequest="400"
                       TextColor="{StaticResource NightBlue}"
                       IsVisible="{Binding 
                        Path=BindingContext.CurrentQuestion.QuestionType,
                        Converter={StaticResource QuestionTypeIsEntryToBooleanConverter}, 
                        Source={x:Reference refTestView}}" />
            </Grid>
        </DataTemplate>
    </CollectionView.ItemTemplate>
</CollectionView>

视像Model中的问题类型而定,要么是无线电台、检查箱或可见条目。

没有人理解,为什么出现这一问题? 这是否与旁边执行射线和进入有关?

最佳回答

正如Jason提到的那样,由于你没有具体说明控制收发函的<密码>的任何具体内容,每行都根据自己的内容单独计算自己的布局。

如果你希望<条码>CheckBox成为每一行的同一大小,你可以为其规定一个特定的高度和宽度。

For example:

<CheckBox Grid.Row="0"  
          Grid.Column="0"
          BackgroundColor="Yellow"
          Color="{StaticResource AlpineBlue}" 
          WidthRequest="30" 
          HeightRequest="30"/>
问题回答

暂无回答




相关问题
How to start to create an application GUI using C#?

HI! I am new to C# and plan to use it for my application GUI. I am trying to make my GUI similar to SPSS:http://www.spss.com/images/08/statistics_screens/ez_rfm-big.jpg Is this easy in C#? Is there ...

Automatic height of edit box

My shoes application has three items stacked on top of each other (with a stack, of course), in order: A banner An edit box Two buttons in a flow What I want to do is have the banner stay at it s ...

Search by using the keyboard in a list/grid - algorithm

I need to implement a custom search in a grid and I would like to find some user interface guidelines that explain the standard way to implement it. I mean this kind of search that is initiated by ...

UI And TcpClient Issue in vb.net

I m having some problems with a small ircbot i m writing. Basically I connect to the server using a tcpclient in a seperate class, which also runs on its own thread. I want to display the server text ...

UI Convention: Shortcut key for application exit? [closed]

Is there a convention for the shortcut keys for application exit? Some applications uses Alt+X some others use Ctrl+ X and Ctrl+Q. Applications like FF and IE doesnot assign a shortcut at all. So is ...

热门标签