RE: [flexcoders] vertically centering text
I'm CERTAIN there has to be a more elegant way, but this should work - put the label inside a VBox with spacers set to 50% height above and below... mx:DataGridColumn headerText=Name mx:itemRenderer mx:Component mx:VBox mx:Spacer height=50% mx:Label text={data.fullName}/ mx:Spacer height=50% /mx:VBox /mx:Component /mx:itemRenderer /mx:DataGridColumn Rick -Original Message- From: Pan Troglodytes [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 06, 2006 6:15 PM To: flexcoders Subject: [flexcoders] vertically centering text Is there any way to vertically center text? Specifically, I have a datagrid column that I want to have the text centered vertically in. mx:DataGridColumn headerText=Name mx:itemRenderer mx:Component mx:Label text={data.fullName}/ /mx:Component /mx:itemRenderer /mx:DataGridColumn Since there is also a image field, the height of each row is a lot higher than the text and I don't like how it looks. I can't find any property that seems to apply. I know there is a verticalCenter property, but it takes an int and seems to be completely undocumented in the Flex help. I've also tried working with styles but I couldn't find anything that would apply. -- Jason
Re: [flexcoders] vertically centering text
Thanks for the replies. Looks like Patrick's method with just the VBox works great without any appreciable slowdown. On 12/6/06, Patrick Mineault [EMAIL PROTECTED] wrote: If your item renderer was a VBox you could set verticalAlign to middle. That might slow your app down if you have a lot of rows with VBoxes versus just plain Components. Patrick Pan Troglodytes a écrit : Is there any way to vertically center text? Specifically, I have a datagrid column that I want to have the text centered vertically in. mx:DataGridColumn headerText=Name mx:itemRenderer mx:Component mx:Label text={data.fullName}/ /mx:Component /mx:itemRenderer /mx:DataGridColumn Since there is also a image field, the height of each row is a lot higher than the text and I don't like how it looks. I can't find any property that seems to apply. I know there is a verticalCenter property, but it takes an int and seems to be completely undocumented in the Flex help. I've also tried working with styles but I couldn't find anything that would apply. -- Jason -- Jason
[flexcoders] vertically centering text
Is there any way to vertically center text? Specifically, I have a datagrid column that I want to have the text centered vertically in. mx:DataGridColumn headerText=Name mx:itemRenderer mx:Component mx:Label text={data.fullName}/ /mx:Component /mx:itemRenderer /mx:DataGridColumn Since there is also a image field, the height of each row is a lot higher than the text and I don't like how it looks. I can't find any property that seems to apply. I know there is a verticalCenter property, but it takes an int and seems to be completely undocumented in the Flex help. I've also tried working with styles but I couldn't find anything that would apply. -- Jason
Re: [flexcoders] vertically centering text
If your item renderer was a VBox you could set verticalAlign to middle. That might slow your app down if you have a lot of rows with VBoxes versus just plain Components. Patrick Pan Troglodytes a écrit : Is there any way to vertically center text? Specifically, I have a datagrid column that I want to have the text centered vertically in. mx:DataGridColumn headerText=Name mx:itemRenderer mx:Component mx:Label text={data.fullName}/ /mx:Component /mx:itemRenderer /mx:DataGridColumn Since there is also a image field, the height of each row is a lot higher than the text and I don't like how it looks. I can't find any property that seems to apply. I know there is a verticalCenter property, but it takes an int and seems to be completely undocumented in the Flex help. I've also tried working with styles but I couldn't find anything that would apply. -- Jason