Bonjour,
Je cherche une méthode pour centrer verticalement mon texte dans une "static text".
Il y a bien la fonction horizontalAlignement pour l'horizontale mais pour la verticale ???
Merci et bonne soirée
Olivier
(matlab 7.4.0.287 (R2007a))
Bonjour,
Je cherche une méthode pour centrer verticalement mon texte dans une "static text".
Il y a bien la fonction horizontalAlignement pour l'horizontale mais pour la verticale ???
Merci et bonne soirée
Olivier
(matlab 7.4.0.287 (R2007a))
Je ne crois pas que cela soit possible...
Une alternative consiste à placer un objet Text (fonction TEXT) dans un objet Axes à la place d'un objet UIControl StaticText.
On peut bien entendu rendre l'objet Axes invisible (propriété Visible mise à Off) si la couleur de fond est la même que celle de la Figure (ou du Uipanel)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 figure uicontrol('units','normalized',... 'position',[.1 .1 .3 .8],... 'style','text',... 'string','AAAAAAAAAAAAAAA',... 'backgroundcolor','c') ax = axes('units','normalized',... 'position',[.6 .1 .3 .8],... 'color',[0 1 1],... 'ylim',[0 1],... 'xlim',[0 1],... 'xtick',[],... 'ytick',[],... 'xcolor',[0 1 1],... 'ycolor',[0 1 1]); text(.5,.5,'AAAAAAAAAAAAAAA', ... 'parent',ax,... 'verticalalignment','middle', ... 'horizontalalignment','center')
Partager