- 2 minutes to read
By default, a Card View arranges cards in columns. The first card is displayed at a View’s top-left corner. Subsequent cards are positioned under the previous ones. If a card cannot be placed there without being truncated, it is placed at the top of the next column. Subsequent cards are positioned under this card, etc.
Cards can also be arranged in rows. In this instance, set the CardView.CardLayout property to CardLayout.Rows. In this case, the first card is displayed at a View’s top left corner. Subsequent cards are positioned next to the previous ones. If a card cannot be entirely displayed, it is displayed on the next row, etc.
The maximum number of cards in a row (or column) is specified by the CardView.MaxCardCountInRow property.
The alignment of cards is specified by the CardView.CardAlignment property. The table below shows all possible card alignments:
By default, a card’s size (its width or height depending on the layout) is automatically calculated to display its content in the optimal way. As a result, different cards can have different sizes. To avoid this, and specify the same size for all cards displayed within a view, use the CardView.FixedSize property. The minimum size to which a card can be resized is specified by the CardView.MinFixedSize property.