Je ne comprends pas très bien vos besoins. Voulez-vous rendre les proportions de disposition de ces quatre boutons identiques sur 6 et 6P ? Vous pouvez obtenir la valeur de la largeur de l'écran et charger d'autres largeurs, hauteurs, espacements, etc. en fonction de la largeur let width = UIScreen.mainScreen().bounds.width
Utiliser la maçonnerie est simple,
1. Créez une grande vue nommée bigView ;
2. Créez quatre boutons et ajoutez-les à bigView ;
3.
Je ne comprends pas très bien vos besoins. Voulez-vous rendre les proportions de disposition de ces quatre boutons identiques sur 6 et 6P ?
Vous pouvez obtenir la valeur de la largeur de l'écran et charger d'autres largeurs, hauteurs, espacements, etc. en fonction de la largeur
let width = UIScreen.mainScreen().bounds.width
Le point clé est le rapport à la vue parent, comme indiqué ci-dessous :