به عنوان مثال، اگر یک نقشه برداری برداری داشتید که می خواستید با پیش فرض های Material بارگذاری کنید، می توانید از Icon composable به صورت زیر استفاده کنید:
به طور پیش فرض، Icon composable با LocalContentColor.current رنگ آمیزی شده است و اندازه آن 24.dp است. همچنین یک پارامتر رنگ tint را نشان می دهد (که از همان مکانیسمی که در بخش tint تصویر توضیح داده شده است برای رنگ آمیزی استفاده می کند). Icon composable برای استفاده برای عناصر آیکون کوچک در نظر گرفته شده است. برای سفارشی سازی بیشتر باید از Image composable استفاده کنید.
{% کلمه به کلمه %} {% آخر کلمه %}
برای شما توصیه می شود
توجه: وقتی جاوا اسکریپت خاموش است، متن پیوند نمایش داده می شود
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-08-28 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-28 بهوقت ساعت هماهنگ جهانی."],[],[],null,["The `Icon` composable is a convenient way to draw a single color icon on screen\nthat follows [Material Design guidelines](https://material.io/design/iconography/system-icons.html#grid-and-keyline-shapes). To use `Icon`, include\nthe [Compose Material](/jetpack/androidx/releases/compose-material) library (or the [Compose Material 3](/jetpack/androidx/releases/compose-material3) library).\n\nFor example, if you had a vector drawable that you wanted to load up with\nMaterial defaults, you can use the `Icon` composable as follows:\n\n\n```kotlin\nIcon(\n painter = painterResource(R.drawable.baseline_directions_bus_24),\n contentDescription = stringResource(id = R.string.bus_content_description)\n)https://github.com/android/snippets/blob/dd30aee903e8c247786c064faab1a9ca8d10b46e/compose/snippets/src/main/java/com/example/compose/snippets/images/MaterialIconsSnippets.kt#L47-L50\n```\n\n\u003cbr /\u003e\n\nBy default, the `Icon` composable is tinted with `LocalContentColor.current` and\nis `24.dp` in size. It also exposes a `tint` color parameter (which leverages\nthe same mechanism for tinting as described in the [Image tint](/develop/ui/compose/graphics/images/customize#tint-image) section). The\n`Icon` composable is intended for use for small icon elements. You should use\nthe `Image` composable for more customization options.\n| **Note:** With Material there are two different styles of icons, Material Symbols (New) and Material Icons (`material-icons`). The [Material Icon library](/reference/kotlin/androidx/compose/material/icons/package-summary) includes a set of predefined `Icons` that can be used in Compose without needing to import an SVG manually. However, this artifact is no longer maintained or recommended for use in your apps, as it contains an older look and feel and can also increase the build time of your apps *significantly* . Instead, we recommend using [Google Font Icons](https://fonts.google.com/icons) and download the XML file from the Android Tab to create an up-to-date Material Symbols style Icon.\n\nRecommended for you\n\n- Note: link text is displayed when JavaScript is off\n- [Resources in Compose](/develop/ui/compose/resources)\n- [Accessibility in Compose](/develop/ui/compose/accessibility)\n- [Loading images {:#loading-images}](/develop/ui/compose/graphics/images/loading)"]]