ย้ายข้อมูลแอปแบบมุมมองที่มีอยู่
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Jetpack Compose ได้รับการออกแบบให้ทำงานร่วมกับ View ได้ตั้งแต่เริ่มต้น คุณสามารถใช้ Compose ภายใน View และในทางกลับกันได้ ฟังก์ชันนี้ช่วยให้คุณ
ใช้ Compose ในแอปที่อิงตาม View ที่มีอยู่ได้โดยไม่ต้องเขียนใหม่
ตั้งแต่ต้น
หน้าต่อไปนี้อธิบายวิธีผสานรวม Compose กับแอปที่มีอยู่
- กลยุทธ์การย้ายข้อมูล: เรียนรู้กลยุทธ์ในการนำ Compose มาใช้ในโค้ดเบสอย่างปลอดภัยและ
ทีละน้อย
- API การทำงานร่วมกัน: ดูข้อมูลเกี่ยวกับ API ของ Compose เพื่อช่วยคุณรวม
Compose กับ UI ที่อิงตาม View
- ข้อควรพิจารณาอื่นๆ: ดูข้อควรพิจารณาอื่นๆ เช่น การกำหนดธีม
สถาปัตยกรรม และการทดสอบขณะย้ายข้อมูลแอปที่อิงตาม View ไปยัง Compose
ตัวอย่าง
ตัวอย่างต่อไปนี้แสดงการทำงานร่วมกันของ Jetpack Compose และ View
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-27 UTC
[null,null,["อัปเดตล่าสุด 2025-08-27 UTC"],[],[],null,["Jetpack Compose was designed with View interoperability right from the start---you\ncan use Compose within Views, and vice versa. This functionality allows you\nto adopt Compose in your existing View-based app without having to rewrite it\nfrom scratch.\n\nThe following pages describe how to integrate Compose with your existing apps:\n\n- [Migration strategy](/develop/ui/compose/migrate/strategy): Learn the strategy to safely and incrementally introduce Compose into your codebase.\n- [Interoperability APIs](/develop/ui/compose/migrate/interoperability-apis): Learn about Compose's APIs to help you combine Compose with View-based UI.\n- [Other considerations](/develop/ui/compose/migrate/other-considerations): Learn other considerations like theming, architecture, and testing while migrating your View-based app to Compose.\n\nSamples\n\nThe following samples demonstrate Jetpack Compose and View interoperability:"]]