이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-04(UTC)
[[["이해하기 쉬움","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-04(UTC)"],[],[],null,["# Auto-animate layout updates\n\nAndroid offers preloaded animation that runs when you change the layout. Set an attribute in the\nlayout to tell the Android system to animate these layout changes, and it carries out system-default\nanimations for you.\n| **Tip** : If you want to supply custom layout animations, create a [LayoutTransition](/reference/android/animation/LayoutTransition) object and supply it to the layout with the [setLayoutTransition()](/reference/android/view/ViewGroup#setLayoutTransition(android.animation.LayoutTransition)) method.\n\nHere's what a default layout animation looks like when adding items to a list: \n**Figure 1.** Layout animation. \n\nCreate the layout\n-----------------\n\nIn your activity's layout XML file, set the `android:animateLayoutChanges` attribute\nto `true` for the layout that you want to enable animations for: \n\n```xml\n\u003cLinearLayout android:id=\"@+id/container\"\n android:animateLayoutChanges=\"true\"\n ...\n/\u003e\n```\n\nAdd, update, or remove items from the layout\n--------------------------------------------\n\nAdd, remove, or update items in the layout, and the items are animated automatically: \n\n### Kotlin\n\n```kotlin\nlateinit var containerView: ViewGroup\n...\nprivate fun addItem() {\n val newView: View = ...\n\n containerView.addView(newView, 0)\n}\n```\n\n### Java\n\n```java\nprivate ViewGroup containerView;\n...\nprivate void addItem() {\n View newView;\n ...\n containerView.addView(newView, 0);\n}\n```"]]