Using Background Images in an Absolute Layout Container


Using the absolute layout container in conjunction with images presents some powerful options for structuring the user interface of an application.

This guide describes how to add images to the absolute layout container; in addition to data controls. Adding background images to an absolute layout container is also covered in this video. You can add background images that appear like a form, such as a 1040 tax return form or a pdf.

 Create the Absolute Container

  1. In the UX Builder on the UX Controls page open the 'Data Controls' menu. Click on the [DropdownBox] option to add a dropdown box control to the component. Give the textbox the name and label of 'species'.

  2. Highlight the dropdown box in the controls tree. Scroll down the properties list on the right to the 'DropDownBox Properties' section. Click the [...] button next to the 'Choices' property.

  3. Select the 'Static' option from the 'Choices are:' list and add the following satic choices to the dropdown.

    Baetis tricaudatus
    Callibaetis fluctuans
    Epeorus pluralis
    Epeorus vitreus
    Ephemerella invaria
    Ephemerella needhami
    Ephemerella subvaria
    Hydropsyche alternans
    Isonychia bicolor
    Leptophlebia cupida
    Maccaffertium ithaca
    Paraleptophlebia adoptiva
    Paraleptophlebia mollis
    Pteronarcys dorsata
    Siplonurus occidentalis
    Taeniopteryx nivalis
  4. In the 'Data Controls' menu click on the [TextBox] option to add a textbox control. Name and label the textbox 'Location'.

  5. Add two more textbox controls to the component. Name and label these controls 'Time' and 'Temperature'.

  6. Highlight all of the textbox controls. Open the 'Containers' menu and click on the [Container] option.

  7. From the Container Type list select the 'AbsoluteLayout' option and click 'OK'

 Define a Background Image for the AbsoluteLayout Container.

  1. Have an image to use as a background, like the one below:

    The areas that appear as whitespace on this image are where new controls will be placed. Make sure to make these spaces large enough for the control. If a dropdown box control is made too small, for example, then it might not display properly when the component is run.
  2. Highlight the opening 'AbsoluteLayout' container tag, [AbsoluteLayout: ABSOLUTELAYOUT_1].

  3. In the properties list on the right check the 'Has background image' checkbox in the 'Container Begin Properties' section.

  4. Click the [...] button next to the 'Background image' property.

  5. Check the 'Image in Web Project or Style' radio button and click the 'Select' button.

  6. Choose the 'Select from Web Project Folder' option.

  7. Click the 'Add Image to Project' button.

  8. Click the up arrow next to the 'Source File' textbox.

  9. Navigate to the image file that you defined. Click 'Open', then 'OK', 'OK', and 'OK' again.

 Place The Absolute Layout Controls over the Image.

  1. Highlight the opening tag for the AbsoluteLayout container, "[AbsoluteLayout: ABSOLUTELAYOUT_1]".

  2. In the properties list on the right, in the 'Container Begin Properties' section, click the [...] button next to the 'Absolute positions for controls' property. The 'Set Absolute Position and Size' editor will open.

  3. In the middle panel of the 'Set Absolute Position and Size' editor find the dotted rectangle that represents the size of the layout. Drag the grey triangle in the lower right-hand corner of the dotted rectangle until the layout size is the same as the image size.

  4. In the fields list in the top left corner highlight the 'species' field.

  5. Place the mouse cursor inside the layout where the species box is defined. Click and hold down the left-hand mouse button and drag out the 'species' dropdown-box control.

  6. Release the mouse button to add the control. Adjust the position of the 'species' dropdown control's border as needed.

  7. Highlight the Location textbox control and drag out the control inside the absolute layout.

  8. Add the 'Time' and 'Temperature' textbox controls to the layout. Click OK to close the editor.

  9. Run the component in Live Preview. You should see the controls displayed inside the absolute layout component.

  10. The dropdown: