Developer Docs - Mobile Docs - Field Container

v1.0

Field Container

Inherits from Xamarin.Forms.Layout

You know those fancy input fields that have the nice labels, borders, required field markers, and all that? Well, the FieldContainer view handles all that fancy work for you.

A FieldContainer displays views that implement the IRockField interface. You can find all the views that implement this interface in the Form Fields section of the documentation. All of these views implement the required properties to get the title of the field as well as know if the field should be considered required.

The fields can be displayed in one of two ways. Either as individual fields or as grouped fields. An example of the grouped fields would be the login block. The username and password fields are displayed in a single grouping that contains both fields. While a good example of individual fields would be the workflow entry block, each field is displayed one at a time.

Usually, you will want to display fields individually, unless you have full control over the titles. The reason for this is that the titles take up much more space in a Grouped layout vs an Individual layout. So if you are, for example, displaying attributes in a Grouped layout, some of those attributes might have names consisting of 10-15 words, which will just look really odd in the Grouped layout.

Finally, on the layout, some fields require an Individual layout. One example of this is the Address field. It actually displays its components in a grouped stack already, so trying to force that inside another Grouped layout will result in a visual headache.

Properties

Field Layout


    
    


    

The above will render an Individual field (since there is only one). It will display the label Your Name above and then have the text input box placed below it.