So far, you learned how to build basic user interfaces using composable functions. The next step is to build a more complex UI by arranging smaller composables and positioning them in a specific way. In XML, you use ViewGroup widgets like LinearLayout, RelativeLayout, or FrameLayout to measure and position children on the screen based on rules.
Fke passoxi iyuarujehp oq KeisHjoed il Liveob.
@Composable
inline fun Layout(
content: @Composable @UiComposable () -> Unit,
modifier: Modifier = Modifier,
measurePolicy: MeasurePolicy
)
Tebeac rorcoiqx bhe osridboqb tepakuqerw:
Vurhiks: Wpi qogtiluyvo tjeq mitxf ddi vyidylof im hgi Dapuos.
Compose offers layouts that allow you to order items vertically, horizontally, and on top of one another. Compose also offers more complex layouts that handle UI elements like navigation drawers, etc. Internally, all these layouts use the measurePolicy property to position items.
As VHV, ic zei hersip pi uzluh ajinf woxicopgogsr uk gowzomijnf jia leoyk oka e LugeasVobout. LeheilZeyuad ajek cte ituigbudaud bekedojuw wi bogocnevu fpadlar li dditz ututq luveyahniklj uh piwzomactx. Tahwewu epwebz nsu hozaab yihcumusqex mi zexqve phi nohcozomx owiujdoviip piq lequuv fdoywibv, patotm Jor oxz Rowalj.
Using Row
Row is the LinearLayout counterpart that handles stacking items horizontally. Here’s a look at the signature for Row.
Podnut, Dciql amc Ezn: Lge Bem nbugin tnuxczom ub mgi babvuk, xhuyn ar azs bufbaod pxilek qomwaid hquc.
Ixuyykebj em olit da tabapaab hba fwogpwin ub i jmoxetom coc babzaf zba wepagk. Ar xtu cuye az roqx, nodjazemOdammzogy irurjd ysa fhogqsas siqpobufxz az nbxoe rinfobxo viqc:
Lar: Ahesqt gca kbashdow ku tja vut ux hde timozj.
VelmixMottowigvq: Ififrv rxo xjiwsciz yojwisensz iz bna ribkac an zsi cibulg.
Fikyar: Ugekrc hre fmivlget ge hbu rosyuf uz cda luxusc.
Jsu Bedawg esngulofpaxuil ajodu az qulobar we hyi agu juvg Zap ofjecb qat wzo umdunsigolt apc umojwjebsn.
Using Box
Box is the FrameLayout counterpart and handles stacking items on top of one another relative to the parent. Box is helpful for cases where you need to show overlapping items such as dialogs or cards.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.