The layout in a
TMBarView is probably the most crucial part of the puzzle, it defines the overall look and feel of a bar.
TMBarLayout is responsible for inserting, removing and positioning
TMBarButtons in the view hierarchy. It is also tasked with interpreting a raw page position and providing a frame for ‘focus’ - the frame in which the bar should indicate current page status.
You are expected to use a
TMBarLayout subclass such as
TMBarHorizontalLayout or roll with your own for a completely custom look.
TMBarLayoutdictates the way that BarButtons are displayed within a bar, handling layout and population.
Attention: You should not directly use
BarLayout, but instead inherit from it or use an available subclass such as
open class TMBarLayout : TMBarViewFocusProvider, TMTransitionStyleable
Layout that displays bar buttons sequentially along the horizontal axis, but is constrained by the number of items it can display.
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 / visibleButtonCountrather than using intrinsic sizing.
open class TMConstrainedHorizontalBarLayout : TMHorizontalBarLayout