Comment puis-je obtenir la police barre d'outils pour correspondre UINavigationController?
-
12-09-2019 - |
Question
utilisez poste suivant, j'ai pu ajouter un UILabel à un UIToolbar, cependant, il semble merdique. Quelqu'un sait comment obtenir la taille du texte / couleur / ombre pour correspondre au titre d'un UINavigationController?
Navigation Controller
texte alt http://www.codingwithoutcomments.com/uploads/Picture1.png
UIToolbar avec UILabel
texte alt http://www.codingwithoutcomments.com/uploads/Picture2.png
Quelles mesures dois-je prendre pour les faire correspondre?
La solution
Vous pouvez également ajouter une ombre?
itemLabel.shadowColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];
itemLabel.shadowOffset = CGSizeMake(0, -1.0);
Autres conseils
Il est évident que la question est sur iPhone, mais au cas où quelqu'un se demande, voici les chiffres pour iPad:
titleLabel.font = [UIFont boldSystemFontOfSize:20.0];
titleLabel.shadowOffset = CGSizeMake(0, 1);
titleLabel.shadowColor = [UIColor colorWithWhite:1.f alpha:.5f];
titleLabel.textColor = [UIColor colorWithRed:113.f/255.f green:120.f/255.f blue:127.f/255.f alpha:1.f];
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.text = @"Title";
UILabel * itemLabel = [[UILabel alloc] initWithFrame:rectArea];
itemLabel.text = @"Item";
itemLabel.textColor = [UIColor whiteColor];
itemLabel.font = [UIFont boldSystemFontOfSize:22.0];
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow