现在的位置: 首页 > 综合 > 正文

继承自GridView实现不规则宫格布局失败问题

2017年10月19日 ⁄ 综合 ⁄ 共 487字 ⁄ 字号 评论关闭

根据demo实现不规则宫格布局的时候发现设置行列的时候不起作用。

VariableSizedWrapGrid.SetRowSpan(element as ContentControl, rowVal);
VariableSizedWrapGrid.SetColumnSpan(element as ContentControl, colVal);

原因如下:没有设置VariableSizedWrapGrid的ItemHeight , ItemWidth (Demo里面没有设置)。

<local:CustomGridView.ItemsPanel>
                        <ItemsPanelTemplate>
                            <VariableSizedWrapGrid ItemHeight="260" ItemWidth="260"/>
                        </ItemsPanelTemplate>
                    </local:CustomGridView.ItemsPanel>

抱歉!评论已关闭.