با رابط کاربری اندروید استودیو آشنا شوید
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
پنجره اصلی Android Studio از چندین ناحیه منطقی تشکیل شده است که در شکل 1 نشان داده شده است.

شکل 1. پنجره اصلی Android Studio.
- نوار ابزار: طیف گسترده ای از اقدامات، از جمله اجرای برنامه خود و راه اندازی ابزارهای Android را انجام دهید.
- نوار پیمایش: در پروژه خود پیمایش کنید و فایل ها را برای ویرایش باز کنید. نمای فشرده تری از ساختار قابل مشاهده در پنجره پروژه ارائه می دهد.
- پنجره ویرایشگر: ایجاد و اصلاح کد. بسته به نوع فایل فعلی، ویرایشگر می تواند تغییر کند. برای مثال، هنگام مشاهده یک فایل طرح بندی، ویرایشگر Layout Editor را نمایش می دهد.
- نوار پنجره ابزار: از دکمه های بیرونی پنجره IDE برای بزرگ کردن یا جمع کردن پنجره های ابزار استفاده کنید.
- پنجره های ابزار: به وظایف خاصی مانند مدیریت پروژه، جستجو، کنترل نسخه و غیره دسترسی داشته باشید. شما می توانید آنها را گسترش دهید و آنها را فرو بریزید.
- نوار وضعیت: وضعیت پروژه شما و خود IDE و همچنین هرگونه هشدار یا پیام را نمایش می دهد.
برای سازماندهی پنجره اصلی برای فضای بیشتر روی صفحه، نوار ابزار و پنجره ابزار را پنهان یا حرکت دهید. همچنین می توانید از میانبرهای صفحه کلید برای دسترسی به اکثر ویژگی های IDE استفاده کنید.
برای جستجو در کد منبع، پایگاههای داده، اقدامات، عناصر رابط کاربری و موارد دیگر، یکی از موارد زیر را انجام دهید:
- کلید Shift را دوبار فشار دهید.
- روی ذره بین در گوشه سمت راست بالای پنجره Android Studio کلیک کنید.
این می تواند بسیار مفید باشد، برای مثال، اگر می خواهید یک اقدام IDE خاص را پیدا کنید که فراموش کرده اید چگونه آن را راه اندازی کنید.
به جای استفاده از پرسپکتیوهای از پیش تعیین شده، Android Studio زمینه شما را دنبال می کند و به طور خودکار پنجره های ابزار مربوطه را در حین کار نمایش می دهد. به طور پیشفرض، پرکاربردترین پنجرههای ابزار به نوار پنجره ابزار در لبههای پنجره برنامه پین میشوند.
با استفاده از موارد زیر در پنجره ابزار حرکت کنید:
- برای بزرگ کردن یا کوچک کردن پنجره ابزار، روی نام ابزار در نوار پنجره ابزار کلیک کنید. همچنین میتوانید پنجرههای ابزار را بکشید، پین کنید، پین کنید، وصل کنید و جدا کنید.
- برای بازگشت به طرحبندی پیشفرض پنجره ابزار فعلی، روی Window > Restore Default Layout کلیک کنید. برای سفارشی کردن طرحبندی پیشفرض، روی Window > Store Current Layout بهعنوان پیشفرض کلیک کنید.
- برای نمایش یا پنهان کردن کل نوار پنجره ابزار، روی نماد پنجره کلیک کنید
در گوشه سمت چپ پایین پنجره Android Studio. - برای پیدا کردن یک پنجره ابزار خاص، نشانگر را روی نماد پنجره ببرید و پنجره ابزار را از منو انتخاب کنید.
همچنین می توانید از میانبرهای صفحه کلید برای باز کردن پنجره های ابزار استفاده کنید. جدول 1 میانبرهای رایج ترین پنجره های ابزار را فهرست می کند.
جدول 1. میانبرهای صفحه کلید برای پنجره ابزار
پنجره ابزار | ویندوز و لینوکس | ماکوها |
---|
پروژه | Alt+1 | دستور +1 |
کنترل نسخه | Alt+9 | Command+9 |
اجرا کنید | Shift+F10 | کنترل + R |
اشکال زدایی | Shift+F9 | کنترل + D |
Logcat | Alt+6 | Command+6 |
بازگشت به ویرایشگر | Esc | Esc |
پنهان کردن همه ویندوز ابزار | Control+Shift+F12 | Command+Shift+F12 |
برای پنهان کردن همه نوارهای ابزار، پنجرههای ابزار و برگههای ویرایشگر، روی View > Enter Distraction Free Mode کلیک کنید. برای خروج از حالت آزاد حواسپرتی، روی View > Exit Distraction Free Mode کلیک کنید.
از Speed Search برای جستجو و فیلتر کردن در اکثر پنجره های ابزار در Android Studio استفاده کنید. برای استفاده از جستجوی سریع، پنجره ابزار را انتخاب کنید و سپس عبارت جستجوی خود را تایپ کنید.
تکمیل کد
اندروید استودیو دارای سه نوع تکمیل کد است که می توانید با استفاده از میانبرهای صفحه کلید به آنها دسترسی داشته باشید.
جدول 2. میانبرهای صفحه کلید برای تکمیل کد
تایپ کنید | توضیحات | ویندوز و لینوکس | macOS |
---|
تکمیل پایه | پیشنهادات اساسی برای متغیرها، انواع، روش ها، عبارات و غیره را نمایش می دهد. اگر تکمیل اولیه را دو بار متوالی فراخوانی کنید، نتایج بیشتری را مشاهده خواهید کرد، از جمله اعضای خصوصی و اعضای ثابت غیروارد شده. | کنترل + فضا | کنترل + فضا |
تکمیل هوشمند | گزینه های مربوطه را بر اساس زمینه نمایش می دهد. تکمیل هوشمند از نوع مورد انتظار و جریان داده آگاه است. اگر دو بار پشت سر هم با Smart Completion تماس بگیرید، نتایج بیشتری از جمله زنجیرهها مشاهده میکنید. | Control+Shift+Space | Control+Shift+Space |
تکمیل بیانیه | عبارت فعلی را برای شما تکمیل میکند، پرانتز، براکت، پرانتز، قالببندی و غیره را اضافه میکند. | Control+Shift+Enter | Command+Shift+Enter |
برای انجام رفع سریع و نمایش اقدامات قصد، Alt+Enter را فشار دهید .
کد نمونه را پیدا کنید
مرورگر نمونه کد در اندروید استودیو به شما کمک می کند نمونه کدهای اندرویدی با کیفیت بالا و ارائه شده توسط Google را بر اساس نمادی که در حال حاضر در پروژه خود برجسته شده است، پیدا کنید. برای اطلاعات بیشتر، به یافتن کد نمونه مراجعه کنید.
ناوبری
در اینجا چند نکته وجود دارد که به شما کمک می کند تا در Android Studio پیمایش کنید.
برای جابهجایی بین فایلهایی که اخیراً به آنها دسترسی پیدا کردهاید، از عملکرد فایلهای اخیر استفاده کنید:
برای نمایش اکشن Recent Files ، Control+E ( Command+E در macOS) را فشار دهید. به طور پیش فرض، آخرین فایل دسترسی انتخاب شده است. با این عمل می توانید از طریق ستون سمت چپ به هر پنجره ابزاری نیز دسترسی داشته باشید.
از اکشن File Structure برای مشاهده ساختار فایل فعلی استفاده کنید و به سرعت به هر بخشی از فایل فعلی خود بروید:
برای نمایش اکشن File Structure ، Control+F12 ( Command+F12 در macOS) را فشار دهید.
از عمل Navigate to Class برای جستجو و پیمایش به یک کلاس خاص در پروژه خود استفاده کنید. Navigate to Class از عبارات پیچیده پشتیبانی می کند، از جمله camel humps (که به شما امکان می دهد با حروف بزرگ در نام شتر یک عنصر جستجو کنید)، مسیرها، پیمایش خط به (که به شما امکان می دهد به یک خط خاص در فایل بروید)، تطبیق نام میانی (که به شما امکان می دهد بخشی از نام کلاس را جستجو کنید) و بسیاری موارد دیگر. اگر دو بار پشت سر هم آن را فراخوانی کنید، نتایج خارج از کلاس های پروژه را به شما نشان می دهد.
برای نمایش اکشن Navigate to Class ، Control+N ( Command+O در macOS) را فشار دهید.
برای پیمایش به یک فایل یا پوشه از کنش Navigate to File استفاده کنید:
برای نمایش اکشن Navigate to File ، Control+Shift+N ( Command+Shift+O در macOS) را فشار دهید. برای جستجوی پوشهها به جای فایلها، یک "/" در انتهای عبارت خود اضافه کنید.
از کنش Navigate to Symbol برای پیمایش به یک روش یا فیلد با نام استفاده کنید:
برای نمایش اکشن Navigate to Symbol ، Control+Shift+Alt+N ( Command+Option+O در macOS) را فشار دهید.
برای پیدا کردن تمام کدهایی که به کلاس، روش، فیلد، پارامتر یا عبارت در موقعیت مکان نما اشاره می کنند، Alt+F7 ( Option+F7 در macOS) را فشار دهید.
همانطور که شما ویرایش می کنید، Android Studio به طور خودکار قالب بندی و سبک های مشخص شده در تنظیمات سبک کد شما را اعمال می کند. میتوانید تنظیمات سبک کد را با زبان برنامهنویسی، از جمله تعیین قراردادها برای زبانهها و تورفتگیها، فاصلهها، بستهبندی و پرانتز و خطوط خالی سفارشی کنید.
برای سفارشی کردن تنظیمات سبک کد، روی File > Settings > Editor > Code Style ( Android Studio > Preferences > Editor > Code Style در macOS کلیک کنید.)
اگرچه IDE به طور خودکار قالب بندی را در حین کار اعمال می کند، شما همچنین می توانید به صراحت عمل Reformat Code را فراخوانی کنید. برای فراخوانی اکشن، Control+Alt+L ( Opt+Command+L در macOS) را فشار دهید. برای ایجاد تورفتگی خودکار همه خطوط، Control+Alt+I ( Control+Option+I در macOS) را فشار دهید.

شکل 2. کد قبل از قالب بندی.

شکل 3. کد پس از قالب بندی.
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-07-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Get to know the Android Studio UI\n\nThe Android Studio main window consists of several logical areas, shown in\nFigure 1.\n\n\n**Figure 1.** The Android Studio main window.\n\n1. **Toolbar:** Carry out a wide range of actions, including running your app and launching Android tools.\n2. **Navigation bar:** Navigate through your project and open files for editing. It provides a more compact view of the structure visible in the **Project** window.\n3. **Editor window:** Create and modify code. Depending on the current file type, the editor can change. For example, when viewing a layout file, the editor displays the Layout Editor.\n4. **Tool window bar:** Use the buttons on the outside of the IDE window to expand or collapse individual tool windows.\n5. **Tool windows:** Access specific tasks like project management, search, version control, and more. You can expand them and collapse them.\n6. **Status bar:** Display the status of your project and the IDE itself, as well as any warnings or messages.\n\nTo organize the main window for more screen space, hide or move the toolbars\nand tool windows. You can also use\n[keyboard shortcuts](/studio/intro/keyboard-shortcuts) to\naccess most IDE features.\n\nTo search across your source code, databases, actions,\nelements of the user interface, and more, do one of the following:\n\n- Double-press the \u003ckbd\u003eShift\u003c/kbd\u003e key.\n- Click the magnifying glass in the upper right-hand corner of the Android Studio window.\n\nThis can be very useful if, for example, you are trying to\nlocate a particular IDE action that you have forgotten how to trigger.\n\nTool windows\n------------\n\nInstead of using preset perspectives, Android Studio follows your context and\nautomatically brings up relevant tool windows as you work. By default, the most\ncommonly used tool windows are pinned to the tool window bar at the edges of\nthe application window.\n\nNavigate the tool window using the following:\n\n- To expand or collapse a tool window, click the tool's name in the tool window bar. You can also drag, pin, unpin, attach, and detach tool windows.\n- To return to the default layout of the current tool window, click **Window \\\u003e Restore Default Layout** . To customize your default layout, click **Window \\\u003e Store Current Layout as Default**.\n- To show or hide the entire tool window bar, click the window icon in the bottom left-hand corner of the Android Studio window.\n- To locate a specific tool window, hover over the window icon and select the tool window from the menu.\n\nYou can also use [keyboard shortcuts](/studio/intro/keyboard-shortcuts) to\nopen tool windows. Table 1 lists the shortcuts for the most common tool windows.\n\n\n**Table 1.** Keyboard shortcuts for tool windows\n\n| Tool window | Windows and Linux | macos |\n|-----------------------|------------------------------|------------------------------|\n| Project | \u003ckbd\u003eAlt+1\u003c/kbd\u003e | \u003ckbd\u003eCommand+1\u003c/kbd\u003e |\n| Version Control | \u003ckbd\u003eAlt+9\u003c/kbd\u003e | \u003ckbd\u003eCommand+9\u003c/kbd\u003e |\n| Run | \u003ckbd\u003eShift+F10\u003c/kbd\u003e | \u003ckbd\u003eControl+R\u003c/kbd\u003e |\n| Debug | \u003ckbd\u003eShift+F9\u003c/kbd\u003e | \u003ckbd\u003eControl+D\u003c/kbd\u003e |\n| Logcat | \u003ckbd\u003eAlt+6\u003c/kbd\u003e | \u003ckbd\u003eCommand+6\u003c/kbd\u003e |\n| Return to Editor | \u003ckbd\u003eEsc\u003c/kbd\u003e | \u003ckbd\u003eEsc\u003c/kbd\u003e |\n| Hide All Tool Windows | \u003ckbd\u003eControl+Shift+F12\u003c/kbd\u003e | \u003ckbd\u003eCommand+Shift+F12\u003c/kbd\u003e |\n\nTo hide all toolbars, tool windows, and editor tabs, click\n**View \\\u003e Enter Distraction Free Mode** . To exit Distraction Free Mode, click\n**View \\\u003e Exit Distraction Free Mode**.\n\nUse *Speed Search* to search and filter within most tool windows\nin Android Studio. To use Speed Search, select the tool window and then type\nyour search query.\n\nCode completion\n---------------\n\nAndroid Studio has three types of code completion, which you can access using\nkeyboard shortcuts.\n\n\n**Table 2.** Keyboard shortcuts for code completion\n\n| Type | Description | Windows and Linux | macOS |\n|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------|--------------------------------|\n| Basic Completion | Displays basic suggestions for variables, types, methods, expressions, and so on. If you call basic completion twice in a row, you see more results, including private members and non-imported static members. | \u003ckbd\u003eControl+Space\u003c/kbd\u003e | \u003ckbd\u003eControl+Space\u003c/kbd\u003e |\n| Smart Completion | Displays relevant options based on the context. Smart completion is aware of the expected type and data flows. If you call Smart Completion twice in a row, you see more results, including chains. | \u003ckbd\u003eControl+Shift+Space\u003c/kbd\u003e | \u003ckbd\u003eControl+Shift+Space\u003c/kbd\u003e |\n| Statement Completion | Completes the current statement for you, adding missing parentheses, brackets, braces, formatting, and so on. | \u003ckbd\u003eControl+Shift+Enter\u003c/kbd\u003e | \u003ckbd\u003eCommand+Shift+Enter\u003c/kbd\u003e |\n\nTo perform quickfixes and show intention actions, press\n\u003ckbd\u003eAlt+Enter\u003ckbd\u003e.\u003c/kbd\u003e\u003c/kbd\u003e\n\nFind sample code\n----------------\n\nThe Code Sample Browser in Android Studio helps you find high-quality,\nGoogle-provided Android code samples based on the currently highlighted symbol\nin your project. For more information, see\n[Find sample code](/studio/write/sample-code).\n\nNavigation\n----------\n\nHere are some tips to help you navigate Android Studio.\n\n- Use the **Recent Files** action to switch between your recently accessed\n files:\n\n To bring up the **Recent Files** action, press\n \u003ckbd\u003eControl+E\u003c/kbd\u003e (\u003ckbd\u003eCommand+E\u003c/kbd\u003e on macOS). By default, the\n last accessed file is selected. With this action, you can also access\n any tool window through the left column.\n- Use the **File Structure** action to view the structure of the current file\n and quickly navigate to any part of your current file:\n\n To bring up the **File Structure** action, press \u003ckbd\u003eControl+F12\u003c/kbd\u003e\n (\u003ckbd\u003eCommand+F12\u003c/kbd\u003e on macOS).\n- Use the **Navigate to Class** action to search for and navigate to a\n specific class in your project. **Navigate to Class** supports sophisticated\n expressions, including *camel humps* (which lets you search by the capitalized\n letters in an element's camel-cased name), paths, *line navigate to* (which\n lets you navigate to a specific line within the file), *middle name\n matching* (which lets you search for a part of the class name), and many more.\n If you call it twice in a row, it shows you the\n results out of the project classes.\n\n To bring up the **Navigate to Class** action, press \u003ckbd\u003eControl+N\u003c/kbd\u003e\n (\u003ckbd\u003eCommand+O\u003c/kbd\u003e on macOS).\n- Use the **Navigate to File** action to navigate to a file or folder:\n\n To bring up **Navigate to File** action, press \u003ckbd\u003eControl+Shift+N\u003c/kbd\u003e\n (\u003ckbd\u003eCommand+Shift+O\u003c/kbd\u003e on macOS). To search for folders rather than\n files, add a \"/\" at the end of your expression.\n- Use the **Navigate to Symbol** action to navigate to a method or field by\n name:\n\n To bring up the **Navigate to Symbol** action, press\n \u003ckbd\u003eControl+Shift+Alt+N\u003c/kbd\u003e (\u003ckbd\u003eCommand+Option+O\u003c/kbd\u003e on macOS).\n- To find all the pieces of code referencing the class, method, field,\n parameter, or statement at the current cursor position, press\n \u003ckbd\u003eAlt+F7\u003c/kbd\u003e (\u003ckbd\u003eOption+F7\u003c/kbd\u003e on macOS).\n\nStyle and formatting\n--------------------\n\nAs you edit, Android Studio automatically applies formatting and styles as\nspecified in your code style settings. You can customize the code style\nsettings by programming language, including specifying conventions for tabs and\nindents, spaces, wrapping and braces, and blank lines.\n\nTo customize your code\nstyle settings, click **File \\\u003e Settings \\\u003e Editor \\\u003e Code Style** (**Android\nStudio \\\u003e Preferences \\\u003e Editor \\\u003e Code Style** on macOS.)\n\nAlthough the IDE automatically applies formatting as you work, you can also\nexplicitly call the **Reformat Code** action. To call the action,\npress \u003ckbd\u003eControl+Alt+L\u003c/kbd\u003e (\u003ckbd\u003eOpt+Command+L\u003c/kbd\u003e on macOS). To\nauto-indent all lines, press\n\u003ckbd\u003eControl+Alt+I\u003c/kbd\u003e (\u003ckbd\u003eControl+Option+I\u003c/kbd\u003e on macOS).\n\n\n**Figure 2.** Code before formatting.\n\n\n**Figure 3.** Code after formatting."]]