TMConstrainedHorizontalBarLayout
open class TMConstrainedHorizontalBarLayout : TMHorizontalBarLayout
Layout that displays bar buttons sequentially along the horizontal axis, but is constrained by the number of items it can display.
Based on TMHorizontalBarLayout
. If the bar happens to contain more bar buttons than the visibleButtonCount
, they will be off screen.
You should use this layout if you want to a horizontal layout with a limited amount of buttons, such as a tab bar.
It’s also worth noting that the button width is set to bounds.size.width / visibleButtonCount
rather than using intrinsic sizing.
-
The number of buttons to be visible in the layout.
If the number of buttons exceeds this value, paging will be enabled.
Declaration
Swift
open var visibleButtonCount: Int { get set }
-
Declaration
Swift
open override func layout(in view: UIView)
-
Declaration
Swift
open override func insert(buttons: [TMBarButton], at index: Int)