View
用于布局、绘制、指针输入和无障碍支持的通用保留式容器。
正在加载交互演示…
div()
.p(20.0)
.gap(12.0)
.child(text("Hello from Rust"))
.child(button().on_click(continue_clicked).child("Continue"))#导入
从 quickgui 导入 div。
use quickgui::*;#用法
div()
.p(20.0)
.gap(12.0)
.child(text("Hello from Rust"))
.child(button().on_click(continue_clicked).child("Continue"))#API 参考
展开条目查看说明和完整签名。短横线表示声明中未记录默认值。
div
查看源码pub fn div() -> ElementCreate a container element.
bgpub fn bg(mut self, color: Color) -> Self—
pxpub fn px(mut self, value: f32) -> Self—
hoverpub fn hover(mut self, style: impl FnOnce(ElementStateStyle) -> ElementStateStyle) -> Self—
Configures hover for this part.
pub fn hover(mut self, style: impl FnOnce(ElementStateStyle) -> ElementStateStyle) -> Self查看源码childpub fn child(mut self, child: impl IntoElement) -> Self—
on_clickpub fn on_click<V>(mut self, listener: crate::ClickListener<V>) -> Self—
Attach a listener registered by [`crate::ViewContext::listener`].
pub fn on_click<V>(mut self, listener: crate::ClickListener<V>) -> Self查看源码