IntelliJ IDEA 2018.1 Help

Create Layout Dialog

Project Tool Window | context menu of a package with the application classes | New - Android Component

The dialog box opens when you create a component of the activity or fragment type, and select the Create layout file checkbox.

In this dialog box, specify the layout name, its root element, and the set of qualifiers to be included in this layout.

ItemDescription
File name In this text box, specify the name of the layout definition file associated with the new component. Only lowercase letters and numbers are supported.
Root element In this text box, specify the root element of the layout. Press Ctrl+Space to get a list of available values. The value must be of the View or ViewGroup type, learn more at http://developer.android.com/guide/topics/resources/layout-resource.html.
Directory name In this text box, specify the folder where the layout definition will be stored relative to the res folder.
  • If your application does not need to be compatible with various Android devices and, therefore, no multiple screens support is required, accept the default layout subfolder.
  • To provide alternative resources, specify the resource qualifiers that determine a specific device configuration. Move the relevant qualifiers from the Available qualifiers list to the Chosen qualifiers list and specify their values. IntelliJ IDEA appends all the selected qualifiers to the Directory name field with a dash character as separator.

For details, see Creating Resources.

Available qualifiers From this list, select the resource qualifiers that determine a specific device configuration. Select the relevant qualifier and click icon InsertReplace. Then specify the value of the qualifier in the dialog box that opens. The qualifier is added to the Chosen qualifiers list.
Last modified: 24 July 2018

See Also