Aller au contenu principal
Version: v20

Use formatters

OBJECTIFS

Use built-in formatters.

In this tutorial, we'll show you how to apply built-in formatters to your fields.

Téléchargez le projet Starter

Commençons par télécharger le Projet Starter :

Ouvrir un projet mobile

Go to Labels & Icons in Sections, you'll see that a Formats column is available in the Field Properties area:

Data formatter labels icons

From here, you can select specific formats depending on your needs. You can choose between multiple built-in formats.

Nous allons attribuer le format monnaie au champ "Available Credit" :

Available credit currency

Nous ferons de même pour tous les autres champs :

  • Attribuez le format Monnaie $ au champ "Current Balance"
  • Attribuez le format Pourcentage au champ "Percent Used"
  • Attribuez le format Oui ou non au champ "Credit Limit"
  • Attribuez le format Date courte au champ "Credit Date"

Select field formatters

Créer et exécuter votre projet

Voici le résultat final qui s'affiche dans votre application iOS à l'aide d'un formulaire Liste "Task" et d'un formulaire détaillé "Numbers".

Result data formatter iphone

Vous avez terminé ! Your fields are well formatted according to its defined type in Labels & Icons.