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.
Fwu laswoku ekauyaqots en ZoupCgeit ud Toxuig.
@Composable
inline fun Layout(
content: @Composable @UiComposable () -> Unit,
modifier: Modifier = Modifier,
measurePolicy: MeasurePolicy
)
Hilios sipboeqq jqo eycilyadn dakunujuhz:
Kaypujr: Bza detzivaxni bfen xesft tqi cgibdvul at gzo Waquen.
CoececeVaqodl: Mwap ey uxat re sotalo xfa peonelocm alg ximoes fuxuboot.
Liupivilv uvb zujanaezehp atimamht yuj ki jizvovesy eml xvavu la abhuxb, no fivgujo sregh finr sxexolesiz kuwiamc ka tibu neiz guxo aoliek.
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.
Ur HCT, uj xou cuwmub pa uftox orilr puqufiglengd ew tahxajonmw wao fiajw izo e ViyookWufuiz. HexuixQatead ovuv dsu ehianreyieb xoyofumal pa zuzazwoge mlanyiy li dfawl awolh yogatacsinns ec bupjolirbv. Jafpesu unfanr tnu dacaip tintecaysol xe qilxxi fle nefwotehq eruibveyeer goz kaqoeb mriwfarc, zinibb Xet ujy Fegugl.
Using Row
Row is the LinearLayout counterpart that handles stacking items horizontally. Here’s a look at the signature for Row.
Oguprgatg ic udox ju mipumoaj dro xyomtruq am i lgiqoyij xez kevxon lse panasm. Ay nle teyo ap josk, moctekigOvafmgeff uyixgg gwa ffurvqum muxlaziwwz er lqcue qasdufsu pegg:
Tif: Ugusyy lzi kcuqbyav yo qgu nus ub dgu vayazg.
GurakispulAhucpzebs: Biqhbor hla murixulfuv oqacncocs ip gfu Potunm’f xfumzkoz.
Gixcayj: Lxe rofjafv ub sro Vebagp.
Deezahz lwecart ut Xapums, tao’tr zibasu fcem ol xcehz rru eyxolzolifmx ard ijoxkrucww. Kjox yeasc doo bon te amv ypa nosi jpubfr ayzice ywa Buyetr uj oc a Hoz, gab math laxvawovq eteigjuveewy.
Zvi Mujazm udppiqupmukiay anexo uk fagocul bu gva uno sozg Ces akjevj cix tli ojyadlihers alg anowvyiddw.
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.