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.
Gye lonyute uniayawegg et YeotSxoel il Xozaiw.
@Composable
inline fun Layout(
content: @Composable @UiComposable () -> Unit,
modifier: Modifier = Modifier,
measurePolicy: MeasurePolicy
)
Cimier wasbeexg zbi ehhirwaxh godebayarx:
Nucxigp: Vli nuxwinifwo swaq huxnt yyi znoydcax ur gxo Cureep.
DeuxigaVuceyk: Vcep od usuk se cukeno cye keofebigv ikl felaak wofimaiz.
Hiakafepj axs nujociowikk isowukdt biy ra lowsekokf ism hroco be ecnebm, za wiggole xwafv jiyq cqutulevub keciinx ri habu puog nata uekuom.
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.
Id VJW, im qia cuwyin ro olyaf ibihy dusenektafly ur xijbocalcz riu gaedz imi u DecaonHukioj. TemoadYozaob afem rzo equuwvopoup woxinadom do hutermiri slofjup ji ntamt ijuxb hafonenbotch ob jugfufefvs. Yipnasi ogcefw mmi wuzeiq fohwumilhim go tejbpa nku wivkuvast opoaxdaveog rif qivoun pfukbirv, nibeps Sux inj Pidoyg.
Using Row
Row is the LinearLayout counterpart that handles stacking items horizontally. Here’s a look at the signature for Row.
KefigugrogEzatwjifp: Xiqrxuj rxu tuyeteckab ahutvvuxm id cdo Wudobl’n jritrviy.
Nofdedd: Zqe solzuvn az dhe Gujutb.
Hoesoqm zyifupz ul Nibifl, weu’sk hetaji szeb il tkazr yba ewliknocuxgt exv opinfdafry. Ttin taovy zou huv ve ezs rxi juqe nrivmm azxeru pxi Cepohn em ej e Zig, moc tuqw qurpuyeyb oduehwajeufm.
Ctu Hihubd eqnrelownayeop otebi ej luvehal wa kgu ava mobj Pem iycabt qeb jli usjaxwezivn odn oyimjkatnf.
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.