alignBy
Position the element horizontally such that its alignmentLine aligns with sibling elements also configured to alignBy. alignBy is a form of align, so both modifiers will not work together if specified for the same layout. Within a Column, all components with alignBy will align horizontally using the specified VerticalAlignmentLines or values provided using the other alignBy overload, forming a sibling group. At least one element of the sibling group will be placed as it had Alignment.Start align in Column, and the alignment of the other siblings will be then determined such that the alignment lines coincide. Note that if only one element in a Column has the alignBy modifier specified the element will be positioned as if it had Alignment.Start align.
Example usage:
Samples
androidx.compose.foundation.layout.samples.SimpleRelativeToSiblingsInColumnPosition the element horizontally such that the alignment line for the content as determined by alignmentLineBlock aligns with sibling elements also configured to alignBy. alignBy is a form of align, so both modifiers will not work together if specified for the same layout. Within a Column, all components with alignBy will align horizontally using the specified VerticalAlignmentLines or values obtained from alignmentLineBlock, forming a sibling group. At least one element of the sibling group will be placed as it had Alignment.Start align in Column, and the alignment of the other siblings will be then determined such that the alignment lines coincide. Note that if only one element in a Column has the alignBy modifier specified the element will be positioned as if it had Alignment.Start align.
Example usage: