با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
میتوانید Modifier.imeNestedScroll() به یک محفظه پیمایشی اعمال کنید تا هنگام اسکرول کردن به پایین ظرف، IME را به طور خودکار باز و بسته کنید.
classWindowInsetsExampleActivity:AppCompatActivity(){overridefunonCreate(savedInstanceState:Bundle?){super.onCreate(savedInstanceState)WindowCompat.setDecorFitsSystemWindows(window,false)setContent{MaterialTheme{MyScreen()}}}}@OptIn(ExperimentalLayoutApi::class)@ComposablefunMyScreen(){Box{LazyColumn(modifier=Modifier.fillMaxSize()// fill the entire window.imePadding()// padding for the bottom for the IME.imeNestedScroll(),// scroll IME at the bottomcontent={})FloatingActionButton(modifier=Modifier.align(Alignment.BottomEnd).padding(16.dp)// normal 16dp of padding for FABs.navigationBarsPadding()// padding for navigation bar.imePadding(),// padding for when IME appearsonClick={}){Icon(imageVector=Icons.Filled.Add,contentDescription="Add")}}}
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-08-26 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-08-26 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Use keyboard IME animations\n\nYou can apply `Modifier.imeNestedScroll()` to a scrolling container to open and\nclose the IME automatically when scrolling to the bottom of the container.\n\n\n```kotlin\nclass WindowInsetsExampleActivity : AppCompatActivity() {\n override fun onCreate(savedInstanceState: Bundle?) {\n super.onCreate(savedInstanceState)\n\n WindowCompat.setDecorFitsSystemWindows(window, false)\n\n setContent {\n MaterialTheme {\n MyScreen()\n }\n }\n }\n}\n\n@OptIn(ExperimentalLayoutApi::class)\n@Composable\nfun MyScreen() {\n Box {\n LazyColumn(\n modifier = Modifier\n .fillMaxSize() // fill the entire window\n .imePadding() // padding for the bottom for the IME\n .imeNestedScroll(), // scroll IME at the bottom\n content = { }\n )\n FloatingActionButton(\n modifier = Modifier\n .align(Alignment.BottomEnd)\n .padding(16.dp) // normal 16dp of padding for FABs\n .navigationBarsPadding() // padding for navigation bar\n .imePadding(), // padding for when IME appears\n onClick = { }\n ) {\n Icon(imageVector = Icons.Filled.Add, contentDescription = \"Add\")\n }\n }\n}https://github.com/android/snippets/blob/dd30aee903e8c247786c064faab1a9ca8d10b46e/compose/snippets/src/main/java/com/example/compose/snippets/interop/MigrationOtherConsiderationsSnippets.kt#L66-L102\n```\n\n\u003cbr /\u003e\n\n**Figure 3.** IME animations."]]