frame
Give a view fixed or flexible layout dimensions.
frame(options) follows SwiftUI's fixed and flexible frame forms. Values use pt.
import { Modifier, Text } from "onescript/views"
<Text modifier={Modifier.frame({ width: 120, height: 48 })}>Fixed frame</Text>
<Text modifier={Modifier.frame({ maxWidth: Infinity, alignment: "leading" })}>
Fill available width
</Text>Fixed fields are width and height. Flexible fields are minWidth, idealWidth, maxWidth, minHeight, idealHeight, and maxHeight. maxWidth and maxHeight accept Infinity.
Fixed and flexible fields cannot appear in the same frame() call. A frame allows content to draw outside its bounds; add clipped() when clipping is required.
How is this guide?
Last updated on