{"id":989,"date":"2026-02-14T06:55:17","date_gmt":"2026-02-14T06:55:17","guid":{"rendered":"https:\/\/nurlandroid.com\/?p=989"},"modified":"2026-02-14T06:55:57","modified_gmt":"2026-02-14T06:55:57","slug":"%d0%ba%d0%be%d0%b3%d0%b4%d0%b0-%d0%b8-%d0%bf%d0%be%d1%87%d0%b5%d0%bc%d1%83-%d0%bd%d1%83%d0%b6%d0%bd%d0%be-%d0%b8%d1%81%d0%bf%d0%be%d0%bb%d1%8c%d0%b7%d0%be%d0%b2%d0%b0%d1%82%d1%8c-key-%d0%b2-lazycolumn","status":"publish","type":"post","link":"https:\/\/nurlandroid.com\/?p=989","title":{"rendered":"\u041a\u043e\u0433\u0434\u0430 \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c key \u0432 LazyColumn\/LazyRow? \u0427\u0442\u043e \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?"},"content":{"rendered":"\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u0440\u043e\u0442\u043a\u043e, \u0442\u043e <strong><code>key<\/code> \u0432 <code>LazyColumn\/LazyRow<\/code> \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b Compose \u043f\u043e\u043d\u0438\u043c\u0430\u043b, \u043a\u0430\u043a\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 \u201c\u043a\u0442\u043e \u0435\u0441\u0442\u044c \u043a\u0442\u043e\u201d \u043f\u0440\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0430\u0445\/\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f\u0445\/\u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\u0445.<\/strong><br>\u0411\u0435\u0437 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u043f\u0440\u044b\u0433\u0430\u0442\u044c <code>remember<\/code>-\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438, \u0444\u043e\u043a\u0443\u0441 \u0438 \u0442.\u043f.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 <code>key<\/code> \u0432 LazyColumn\/LazyRow<\/h4>\n\n\n\n<p><code>key<\/code> \u2014 \u044d\u0442\u043e <strong>\u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430<\/strong> \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0441\u043f\u0438\u0441\u043a\u0430. Compose \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u041f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e <strong>\u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441 id=5 \u2014 \u044d\u0442\u043e \u0442\u043e\u0442 \u0436\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0447\u0442\u043e \u0438 \u0440\u0430\u043d\u044c\u0448\u0435<\/strong>, \u0442\u043e\u043b\u044c\u043a\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0434\u0432\u0438\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e.<\/li>\n\n\n\n<li><strong>\u041f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0442\u044b \/ \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \/ \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430<\/strong>, \u0430 \u043d\u0435 \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u043e(!).<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nLazyColumn {\n    items(\n        items = users,\n        key = { user -&gt; user.id } \/\/ \u0432\u043e\u0442 \u0442\u0443\u0442\n    ) { user -&gt;\n        UserRow(user)\n    }\n}\n\n\/\/  \u0418\u043b\u0438\n\nLazyColumn {\n    items(users, key = { it.id }) { user -&gt; ... }\n}\n<\/pre><\/div>\n\n\n<p><strong>\u041a\u043b\u044e\u0447 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u0421\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c<\/strong> \u2014 \u043d\u0435 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>user.id<\/code>).<\/li>\n\n\n\n<li><strong>\u0423\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u0440\u0435\u0434\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/strong> \u2014 \u0438\u043d\u0430\u0447\u0435 Compose \u0431\u0443\u0434\u0435\u0442 \u043f\u0443\u0442\u0430\u0442\u044c.<\/li>\n<\/ul>\n\n\n\n<p><strong>\u0418\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442<\/strong>\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c id \u0438\u0437 \u043c\u043e\u0434\u0435\u043b\u0438 (<code>id: Long<\/code>, <code>UUID<\/code>, <code>String<\/code>, \u0438 \u0442.\u043f.).<\/p>\n\n\n\n<p><strong>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e (\u0438\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>key<\/code>, \u043a\u043e\u0433\u0434\u0430:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0441\u043f\u0438\u0441\u043e\u043a <strong>\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f<\/strong>: \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f\/\u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f\/\u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f<\/li>\n\n\n\n<li>\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0435\u0441\u0442\u044c <strong>\u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435<\/strong>:\n<ul class=\"wp-block-list\">\n<li><code>remember<\/code><\/li>\n\n\n\n<li><code>rememberSaveable<\/code><\/li>\n\n\n\n<li>\u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 (<code>animate*AsState<\/code>, <code>AnimatedVisibility<\/code>)<\/li>\n\n\n\n<li>\u0444\u043e\u043a\u0443\u0441 (TextField \u0432\u043d\u0443\u0442\u0440\u0438)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u0427\u0442\u043e \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 key \u043d\u0435 \u0437\u0430\u0434\u0430\u0442\u044c?<\/h4>\n\n\n\n<p>\u0415\u0441\u043b\u0438 <code><strong>key<\/strong><\/code> \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d, \u0442\u043e <code>LazyColumn<\/code> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <strong>\u0438\u043d\u0434\u0435\u043a\u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435<\/strong> \u043a\u0430\u043a \u043a\u043b\u044e\u0447. \u0418 \u044d\u0442\u043e <strong>\u043b\u043e\u043c\u0430\u0435\u0442<\/strong> \u043a\u043e\u043d\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c UI, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c-\u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a, \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <strong>\u0432 \u043d\u0430\u0447\u0430\u043b\u043e\/\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0443<\/strong>, \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442.<\/p>\n\n\n\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/\u0411\u044b\u043b\u043e\nindex: 0   1   2\nuser:  A   B   C\nkey:   0   1   2\n\n\/\/\u0421\u0442\u0430\u043b\u043e (\u0432\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f D \u0432 \u043d\u0430\u0447\u0430\u043b\u043e)\nindex: 0   1   2   3\nuser:  D   A   B   C\nkey:   0   1   2   3\n<\/pre><\/div>\n\n\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f Compose: &#171;\u0441\u0442\u0430\u0440\u044b\u0439 A \u0441 key=0&#187; => \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e &#171;D \u0441 key=0&#187;, &#171;\u0441\u0442\u0430\u0440\u044b\u0439 B \u0441 key=1&#187; => &#171;\u0442\u0435\u043f\u0435\u0440\u044c A \u0441 key=1&#187;.<\/p>\n\n\n\n<p>\u0418 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>remember<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u0430\u0439\u0442\u0435\u043c\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 &#171;\u043f\u0435\u0440\u0435\u0435\u0437\u0436\u0430\u0442\u044c&#187; \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0433\u043e<\/li>\n\n\n\n<li>\u0441\u043a\u0440\u043e\u043b\u043b \u043c\u043e\u0436\u0435\u0442 \u0434\u0435\u0440\u0433\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\u0445<\/li>\n\n\n\n<li>\u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438\/\u0444\u043e\u043a\u0443\u0441\/selection &#171;\u043f\u0435\u0440\u0435\u0441\u043a\u0430\u043a\u0438\u0432\u0430\u044e\u0442&#187;<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u041a\u043e\u0433\u0434\u0430 <code>key<\/code> \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u0435\u043d<\/h4>\n\n\n\n<p>\u041c\u043e\u0436\u043d\u043e \u041d\u0415 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 <code>key<\/code>, \u0435\u0441\u043b\u0438:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0441\u043f\u0438\u0441\u043e\u043a <strong>\u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u043e\u0440\u044f\u0434\u043e\u043a<\/strong>, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f (<code>items(newList)<\/code> \u0431\u0435\u0437 insert\/remove \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435)<\/li>\n\n\n\n<li>\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b <strong>\u043f\u0440\u043e\u0441\u0442\u044b\u0435<\/strong>, \u0431\u0435\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e <code>remember<\/code> (\u043f\u0440\u043e\u0441\u0442\u043e <code>Text<\/code>, <code>Icon<\/code> \u0438 \u0442.\u043f.)<\/li>\n\n\n\n<li>\u0441\u043f\u0438\u0441\u043e\u043a \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u0439 (\u043c\u0435\u043d\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 3\u20135 \u043f\u0443\u043d\u043a\u0442\u043e\u0432, \u0440\u0435\u0434\u043a\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f)<\/li>\n<\/ul>\n\n\n\n<p>\u041d\u043e \u0434\u0430\u0436\u0435 \u0442\u0430\u043c <strong>\u043d\u0435 \u043d\u0430\u0432\u0440\u0435\u0434\u0438\u0442<\/strong> \u0443\u043a\u0430\u0437\u0430\u0442\u044c key = id, \u0435\u0441\u043b\u0438 \u043e\u043d \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0435\u0441\u0442\u044c.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u0440\u043e\u0442\u043a\u043e, \u0442\u043e key \u0432 LazyColumn\/LazyRow \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b Compose \u043f\u043e\u043d\u0438\u043c\u0430\u043b, \u043a\u0430\u043a\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 \u201c\u043a\u0442\u043e \u0435\u0441\u0442\u044c \u043a\u0442\u043e\u201d \u043f\u0440\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0430\u0445\/\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f\u0445\/\u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\u0445.\u0411\u0435\u0437 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u043f\u0440\u044b\u0433\u0430\u0442\u044c remember-\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438, \u0444\u043e\u043a\u0443\u0441 \u0438 \u0442.\u043f. \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 key \u0432 LazyColumn\/LazyRow key \u2014 \u044d\u0442\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0441\u043f\u0438\u0441\u043a\u0430. Compose \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b: \u041a\u043b\u044e\u0447 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c: \u0418\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c id \u0438\u0437 \u043c\u043e\u0434\u0435\u043b\u0438 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,31],"tags":[],"class_list":["post-989","post","type-post","status-publish","format-standard","hentry","category-compose","category-questions"],"_links":{"self":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts\/989","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=989"}],"version-history":[{"count":2,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts\/989\/revisions"}],"predecessor-version":[{"id":991,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts\/989\/revisions\/991"}],"wp:attachment":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=989"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=989"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}