We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3a70936 + efda412 commit 7513d32Copy full SHA for 7513d32
Sources/FlexLayout.swift
@@ -330,6 +330,21 @@ public final class Flex {
330
return self
331
}
332
333
+ /**
334
+ This property takes the same values as the width and height properties, and specifies the initial size of the
335
+ flex item, before free space is distributed according to the grow and shrink factors.
336
+
337
+ Specifying `nil` set the basis as `auto`, which means the length is equal to the length of the item. If the
338
+ item has no length specified, the length will be according to its content.
339
340
+ - Parameter value: Default value is 0
341
+ */
342
+ @discardableResult
343
+ public func basis(_ percent: FPercent) -> Flex {
344
+ yoga.flexBasis = YGValue(value: Float(percent.value), unit: .percent)
345
+ return self
346
+ }
347
348
//
349
// MARK: Width / height / height
350
0 commit comments