grid 相关问题

此标记含糊不清,请不要使用它。对于行列布局,请使用[grid-layout]。对于CSS Grid布局,请使用[css-grid]。对于HPC设置,请使用[网格计算]。对于R绘图包,请使用[r-grid]。对于多维数据,请使用[matrix]或[array]或[raster]。对于WPF网格控件,请使用[wpfgrid]

在ReactJS中使用动画在网格上添加列

我正在尝试在 antd 中的行上添加一列后添加动画, 这是我的代码 从 'react' 导入 React, { useState }; 从'antd'导入{列,行}; 常量页面 = () => { 常量 [

回答 1 投票 0

有什么方法可以让容器的内容及其滚动条不碰到容器自己的背景图像的边缘?

我正在开发一个网站的一页,该页面的中心仅包含两个垂直对齐的容器。目前,post 元素的内容及其滚动条与边框重叠...

回答 1 投票 0

一个网格中的标签与另一个网格中的值重叠

目前我有一个如下所示的 XML: 目前我有一个如下所示的 XML: <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="redacted" xmlns:templates="redacted" x:Class="redacted"> <ContentPage.Resources> <DataTemplate x:Key="labelTemplate"> <ViewCell> <Grid> <Label Text="{Binding Text}" /> </Grid> </ViewCell> </DataTemplate> <DataTemplate x:Key="buttonTemplate"> <ViewCell> <Grid> <Button Text="{Binding Text}" Clicked="UniversalButtonInterface_Clicked" /> </Grid> </ViewCell> </DataTemplate> <templates:StepItemTemplateSelector x:Key="stepSelectorTemplate" LabelTemplate="{StaticResource labelTemplate}" ButtonTemplate="{StaticResource buttonTemplate}" /> </ContentPage.Resources> <Grid> <StackLayout> <ListView ItemsSource="{Binding Steps}" ItemTemplate="{StaticResource stepSelectorTemplate}"> </ListView> </StackLayout> <local:CameraButton/> </Grid> </ContentPage> 问题是,如果标签较长,它会与第二个网格中的按钮重叠,并且我无法让该网格扩展其高度。我尝试扩展行定义,但高度基本保持不变,并且它仍然与第二个网格重叠,就好像它根本不想移动一样。如果我尝试应用边距/填充,操作将在网格高度的限制内,并且文本/按钮将被截断。 问题示例: 如何确保网格行的高度与标签缩放而不重叠? 默认情况下,ListView 中所有 ViewCell 的高度相同,如果只想调整 Label ViewCell 的高度,可以先将 ListView 的 HasUnevenRows 属性设置为 True: <ListView HasUnevenRows="True" ItemsSource="{Binding Steps}" ItemTemplate="{StaticResource stepSelectorTemplate}"> </ListView> 然后为ViewCell和Label设置合适的高度: <DataTemplate x:Key="labelTemplate"> <ViewCell Height="xxx"> <Grid> <Label Text="{Binding Text}" HeightRequest="xxx"/> </Grid> </ViewCell> </DataTemplate> 这是因为ListView中的HasUnevenRows属性控制是否可以设置单个viewcell的大小,更具体的解释可以参考Size items

回答 1 投票 0

将元素居中至全宽,左侧有一个元素

我正在尝试左对齐一个元素(按钮)并将另一个元素(徽标)在整个宽度上居中。中心的标志总是向右移动一点。在桌面上,我必须向

回答 1 投票 0

如何用Python制作颜色网格?

我正在尝试创建代表颜色混合比例的值网格。我在图中提供了一个示例。我面临的挑战是对角线下方和上方的颜色应该是

回答 1 投票 0

yii2 在 gridview 中更改控制器操作

我有 ItemController 并在 actionView 中放置了 Itempicture 的 gridview,我希望当我单击图标视图时,更新和删除,然后转到 ItempictureController。 那么如何更改控制器活动...

回答 5 投票 0

引导CSS网格

我正在尝试设置一个简单的示例,使用引导CSS的网格功能,并有一个index.html文件,该文件的容器有两行,每行有两列。但不是col...

回答 1 投票 0

如何在 R 中使用网格组合 grobs 以创建闭合形状?

我目前正在编写 ggplot2 扩展,在此过程中我尝试使用网格创建一个填充形状,其中某些边由函数 grobs 定义。我不确定如何获取一棵树...

回答 1 投票 0

如何将Bootstrap卡片在网站上以均匀间距居中?

我正在使用 Bootstrap 开发 React 应用程序,我面临着让 Bootstrap 卡在我的网站上以均匀间距居中的挑战。一个ro中的三张卡片之间的空间...

回答 1 投票 0

我有一个用 *ngFor 创建的角度网格。我在行内放置了一个自动完成功能,但我在建模时遇到了麻烦

`我知道 [(ngModel)]="selected" 对于所有导致问题的行, 我需要一些解决方法来解决并在此处选择输入图像描述时保留每行中的单个项目。 目前...

回答 1 投票 0

用网格将图像居中

我一直在努力开发一个网站,其中包含标题和正文中的图像。然而,我在尝试将图像置于身体部分的中心时遇到了挑战。图片

回答 1 投票 0

如何结合GridSplitter和DataGrid,其中DataGrid必须有垂直滚动条?

我有一个 xaml,或多或少看起来如下(我已经过滤了 Grid 和 RowDefinition 相关条目以显示 Grid、DataGrid 和 RowDefinition 条目: 我有一个 xaml,或多或少看起来如下(我过滤了 Grid 和 RowDefinition 相关条目以显示 Grid、DataGrid 和 RowDefinition 条目: <Grid x:Name="MainGrid"> <Grid.RowDefinitions> <RowDefinition Height="auto" MaxHeight="60"/> <RowDefinition /> </Grid.RowDefinitions> <Grid x:Name="Grd_Header" Grid.Row ="0" MaxHeight="60"> <Grid.RowDefinitions> <RowDefinition Height="0"></RowDefinition> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="10"></RowDefinition> </Grid.RowDefinitions> </Grid> <Grid x:Name="Grd_Data" Grid.Row="1"> <Grid.RowDefinitions> <RowDefinition Height="auto"></RowDefinition> <RowDefinition Height="10"></RowDefinition> <RowDefinition Height="*"></RowDefinition> </Grid.RowDefinitions> <Grid x:Name="Grd_Act" Grid.Row="0" VerticalAlignment="Stretch"> <Grid.RowDefinitions> <RowDefinition Height="30"></RowDefinition> <RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*"></RowDefinition> </Grid.RowDefinitions> <DataGrid Name="..." Grid.Row="1" Grid.Column="0"> <telerik:RadBusyIndicator Grid.Row="0" Grid.RowSpan="2" .../> </Grid> <GridSplitter Grid.Row="1" Height="3" Background="black" HorizontalAlignment="Stretch" /> <Grid x:Name="Grd_plan" Grid.Row="2"> <Grid.RowDefinitions> <RowDefinition Height="auto"></RowDefinition> <RowDefinition Height="*" MinHeight="50"></RowDefinition> <RowDefinition Height="*"></RowDefinition> </Grid.RowDefinitions> <TextBlock Text="planned..." Grid.Row="0" Grid.Column="0"/> <DataGrid Grid.Row="1" ...> <telerik:RadBusyIndicator Grid.RowSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BusyContent="Loading pallets" IsBusy="{Binding IsLoadingGepandeMatrijsPalletten}" Grid.ColumnSpan="2"/> </Grid> </Grid> </Grid> 乍一看,结果看起来或多或少还不错: 但是从我稍微移动 GridSplitter 的那一刻起,它就出现了部分错误:有一个滚动条(绿色),它必须保持存在。但是灰色空间(红色矩形中):它来自哪里? (在调试时,我了解到灰色区域属于一般视图或Grid,称为MainGrid。) 在我忘记之前:Grid.Resources包含不同的Style标签,就像DataGrid的这个标签: <Style TargetType="DataGrid"> <Setter Property="HorizontalAlignment" Value="Stretch"/> <Setter Property="VerticalAlignment" Value="Stretch"/> <Setter Property="AutoGenerateColumns" Value="False"/> <Setter Property="IsReadOnly" Value="True"/> <Setter Property="ColumnWidth" Value="Auto"/> <Setter Property="FontSize" Value="12"/> </Style> 我假设 Grid 元素 “Grd_Act” 和 “Grd_plan” 都在干扰布局。 它们的布局不正确,元素排列不整齐(冗余属性、错误值等)。 修复这些布局问题应该会恢复预期的调整大小行为(由 GridSplitter 触发)。 “Grd_Act” 这个Grid有一个非常奇怪的布局,其中为two元素定义了三行(为什么不是两行?)。 元素的排列也是错误的: RadBusyIndicator 放置在第一行并跨越两行。 DataGrid 放置在第二行,第二行也被跨越 RadBusyIndicator 占据 - 它们重叠。 最后一行是空的,但保留完整的空间/高度(星号大小)。这条线本质上导致了奇怪的调整大小行为。但这样的安排还是错误的。 只需将其设置为两行,每个元素一行: <Grid x:Name="Grd_Act" Grid.Row="0"> <Grid.RowDefinitions> <RowDefinition Height="30" /> <!-- Busy indicator row --> <RowDefinition Height="*" /> <!-- DataGrid row --> </Grid.RowDefinitions> <telerik:RadBusyIndicator Grid.Row="0" .../> <DataGrid Name="..." Grid.Row="1" /> </Grid> “Grd_plan” 这个Grid正确定义了三行,每个元素一行。 但是,元素排列不正确: RadBusyIndicator 与 TextBlock 一起放置在第一行(重叠)。 RadBusyIndicator 的 Grid.RowSpan 属性设置为 2,这没有任何意义(拼写错误?)。相反,该元素必须放置在第三行。 没有定义列,但元素按列排列:TextBlock 显式放置在 0 列中,并且 RadBusyIndicator 跨越两列。您应该删除那些多余的 Grid.Column 和 Grid.ColumnSpan 值。 不要使用 GridRowSpan 除非你的元素按列排列或者你想创建覆盖(使用 z-index)。 <Grid x:Name="Grd_plan" Grid.Row="2"> <Grid.RowDefinitions> <RowDefinition Height="auto" /> <!-- TextBlock row --> <RowDefinition Height="*" MinHeight="50" /> <!-- DataGrid row --> <RowDefinition Height="*" /> <!-- RadBusyIndicator row --> </Grid.RowDefinitions> <TextBlock Grid.Row="0" Text="planned..." /> <DataGrid Grid.Row="1" ...> <telerik:RadBusyIndicator Grid.Row="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BusyContent="Loading pallets" IsBusy="{Binding IsLoadingGepandeMatrijsPalletten}" /> </Grid> 如果您想让繁忙指示器覆盖 DataGrid,只需将它们放在同一行并设置 Panel.ZIndex 属性来控制它们的渲染顺序(z-index)。不需要(或合理)行跨度。

回答 1 投票 0

将数学表达式放入gridExtra表格列标题中

我想输入以下表达式: 2<= x<3, but if I put c(paste0(2 ," <= x <", 3), the result is the one in image 1, which I don't like. On the other hand , if I put c(...

回答 1 投票 0

在网格攻击级别 77 中使用 CSS 网格将红色字段放入红色边框

我在《编码幻想:网格攻击》77 级卡了好几个小时。我尝试了一切,但到目前为止没有任何效果。游戏没有提供任何解决方案,而且我无法跳过该关卡。有谁知道解决办法吗

回答 1 投票 0

网格风格产品卡

我正在使用 React,我想创建一个如图所示的产品卡 我使用地图来适应数据现在的样式,这是我遇到问题的地方,因为我使用了显示网格,这是代码 &...

回答 1 投票 0

当列数组在 Angular 中更新时,Syncfusion 动态列显示空白

我在我的应用程序位置中实现了同步融合网格,我使用动态列数组来渲染列。在列内,我有一些属性,当

回答 1 投票 0

.NET MAUI 动画框架中的布局

我试图弄清楚如何在动画框架中正确显示 CollectionView 元素。 我向您展示了一些图像来理解面糊: 起始位置: 在这里我只想看到...

回答 1 投票 0

在 React 中使用 tailwind CSS 将无序列表放在一行中

以下代码片段从列表中获取项目并按字母顺序对它们进行排序。 {Object.entries(sortedGroups).sort().map(([groupLetter, groupCities]: [string, any]) => ( <> ...

回答 1 投票 0

网格中溢出的行的边框底部不可见

我正在使用网格来呈现表格。 将overflow-x应用于auto,它工作正常,但溢出的内容不会呈现边框底部。 仅供参考,无论什么标准,边框底部都是可见的...

回答 1 投票 0

需要帮助创建一个简单的 html css 网格布局

我对CSS相当陌生,不知道如何使用网格和Flexbox制作这种布局(6个盒子) (https://i.stack.imgur.com/zycwb.png) 我能想到的创建看起来像这样的唯一方法 (...

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.