2013-07-03 5 views
2

J'ai un NSComboBox qui affiche le texte non aligné verticalement. Existe-t-il une méthode d'alignement vertical du texte à l'intérieur d'un NSComboBox?Alignement vertical NSComboBox

enter image description here

Comme vous pouvez le voir, il est très étrange et cela ne change pas sur la base de fontsize. J'ai recherché mais la seule ressource disponible est pour les éléments affichés par popup (comme intercellSpacing ou setItemHeight:).

Merci d'avance.

Répondre

0

essayer:

NSComboBox* cbx = ZGKeyComboBox.new; 
// NSViewMaxYMargin means: The top margin between the receiver and its superview is flexible. 
cbx.autoresizingMask = NSViewMaxYMargin; 
cbx.itemHeight = cbx.itemHeight + 3; // addSubview will center vertically 
NSRect r = NSMakeRect(x, y, width, cbx.itemHeight + 5); 
cbx.frame = r; 
... 
[parent addSubview: cbx];