การดําเนินการของเอดิเตอร์
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Android Studio มีฟีเจอร์ภายในพื้นที่เอดิเตอร์เพื่อปรับปรุงประสิทธิภาพการทำงานของคุณ
ด้วย Jetpack Compose
เทมเพลตแบบสด
Android Studio มาพร้อมกับ Live Template ที่เกี่ยวข้องกับ Compose เหล่านี้ ซึ่งช่วยให้คุณ
ป้อนโค้ด Snippet เพื่อแทรกได้อย่างรวดเร็วโดยพิมพ์ตัวย่อของเทมเพลตที่เกี่ยวข้อง
comp
เพื่อตั้งค่าฟังก์ชัน @Composable
prev
เพื่อสร้าง@Preview
ฟังก์ชันที่ประกอบกันได้
paddp
เพื่อเพิ่มpadding
ตัวแก้ไขใน dp
weight
เพื่อเพิ่มweight
ตัวปรับแต่ง
W
, WR
, WC
เพื่อล้อมรอบ Composable ปัจจุบันด้วย Box
, Row
หรือ
Column
Container
ไอคอนรางน้ำ
ไอคอน Gutter คือการดำเนินการตามบริบทที่มองเห็นได้ในแถบด้านข้างข้างหมายเลขบรรทัด
Android Studio มีไอคอนแถบด้านข้างหลายรายการที่เฉพาะเจาะจงสำหรับ Jetpack
Compose เพื่อให้คุณได้รับประสบการณ์การพัฒนาแอปที่ง่ายขึ้น
แสดงตัวอย่างการติดตั้งใช้งาน
คุณสามารถติดตั้งใช้งาน @Preview
กับโปรแกรมจำลองหรืออุปกรณ์จริงได้โดยตรงจาก
ไอคอนแถบด้านข้าง
ตัวเลือกสี
เมื่อใดก็ตามที่มีการกำหนดสีภายในหรือภายนอก Composable ระบบจะแสดงตัวอย่างสี
ในแถบด้านข้าง คุณเปลี่ยนสีผ่านเครื่องมือเลือกสีได้โดยคลิกที่เครื่องมือ
ดังนี้
เครื่องมือเลือกทรัพยากรรูปภาพ
เมื่อใดก็ตามที่มีการกำหนด Drawable, Vector หรือรูปภาพภายในหรือภายนอก Composable
ระบบจะแสดงตัวอย่างใน Gutter คุณเปลี่ยนได้ผ่านเครื่องมือเลือกแหล่งข้อมูลรูปภาพ
โดยคลิกที่เครื่องมือเลือกดังนี้
แนะนำสำหรับคุณ
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-27 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-27 UTC"],[],[],null,["# Editor actions\n\nAndroid Studio has features inside the editor area to improve your productivity\nwith Jetpack Compose.\n\nLive templates\n--------------\n\nAndroid Studio comes with these Compose-related live templates, which allow you\nto enter code snippets for fast insertion by typing the corresponding template\nabbreviation:\n\n- `comp` to set up a `@Composable` function\n- `prev` to create a `@Preview` composable function\n- `paddp` to add a `padding` Modifier in dp\n- `weight` to add a `weight` Modifier\n- `W`, `WR`, `WC` to surround the current composable with a `Box`, `Row`, or `Column`container\n\nGutter icons\n------------\n\nGutter icons are contextual actions visible on the sidebar, next to the line\nnumbers. Android Studio introduces several gutter icons specific to Jetpack\nCompose to ease your developer experience.\n\n### Deploy preview\n\nYou can deploy a `@Preview` to the emulator or physical device directly from the\ngutter icon:\n\n### Color picker\n\nWhenever a color is defined inside or outside a composable, its preview is shown\non the gutter. You can change the color via the color picker by clicking on it\nlike this:\n\n### Image resource picker\n\nWhenever a drawable, vector, or image is defined inside or outside a composable,\nits preview is shown on the gutter. You can change it via the image resource\npicker by clicking on it like this:\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [Compose layout basics](/develop/ui/compose/layouts/basics)\n- [Compose modifiers](/develop/ui/compose/modifiers)\n- [Lists and grids](/develop/ui/compose/lists)"]]