Skip to main content

h_virtual_list

Function h_virtual_list 

Source
pub fn h_virtual_list<R, V>(
    view: Entity<V>,
    id: impl Into<ElementId>,
    item_sizes: Rc<Vec<Size<Pixels>>>,
    f: impl 'static + Fn(&mut V, Range<usize>, &mut Window, &mut Context<'_, V>) -> Vec<R>,
) -> VirtualList
where R: IntoElement, V: Render,
Expand description

创建水平方向的 VirtualList

item_sizes 是每个项的尺寸, 仅使用 widthheight 将被忽略,虚拟列表会测量第一个项的高度。

参见 v_virtual_list