Flex :: Get The Line Height Of The Text In A Spark Label?
Jan 31, 2012How do you determine the line height (in pixels) of the text in a Spark Label?
View 2 RepliesHow do you determine the line height (in pixels) of the text in a Spark Label?
View 2 RepliesI am trying to determine the height of a Spark label that becomes multiline at runtime (due to width property being set), to account for text overflow.
(For a spark label named Title) I have tried:
Title.measureText(Title.text).height - this seems to return only the height of one line. (Due to differing screen-sizes and font rendering, I don't know in advance how many lines the text would overflow to...)
Title.height - this seems to return the height of the label size (before being re-adjusted at runtime for multiline text flow)
Both properties above return an unchanging value even when different text lengths/multiple lines long are filled in .text
Is there really no way to determine the exact height of an overflow Spark label?
I am admittedly not that familiar with the Flex API but after scouring the manual for quite some time, I am still unable to place this title label with the proper spacing.
How can I set a line-through style for a s:label like css text-decoration:line-through.
View 1 RepliesI am using spark.label for Mobiles in Flex, I want gradient on label text instead of solid color. But performance should be kept in mind as it will run on mobile device.
View 1 RepliesSuppose I have a (Spark) label. What is the best way to find the length of the text in it? I looked at the myLable.measureText("bla bla") method but it says: To measure text in Spark components, get the measurements of a spark.components.Label or spark.components.RichTextfter looking around I cannot find what this is refering to. I tried myLabel.measureWidth() but this does not return anything usefull (it frequently returns zero). Note: I am explicitly setting the width like this:<s:Lable width="{globalWidthVariable"} .../>If the text overflows I would like to increse the globalWidthVariable to the size of the text.
View 1 RepliesI'm looping through a recordset, and for each item I create at runtime a spark Label and set the text property from a field of the recordset. The labels must have a fixed width and some text goes multiline. I want to arrange the label vertically so I need to know the height of the label so I can place the next label properly, but when I try to read this property, after the labels is added through the addElement mehtod, it returns 0.
how to get the label height?
I'm trying to show a horizontal line under each row of text in a Spark TextArea. I want to give the text area the look of legal paper.
View 2 RepliesIn the Spark DataGrid the default row height is about 22 px. I would like to set the default row height to 18 pixels and I can do this easily enough with the rowHeight property but what happens is when the rowHeight is set to anything less than 22 px the bottom area of the text in each row is cut off. It seems that the default grid itemrenderer or grid label has a min height set to it. Since I have multiple columns and want to have shorter rows but not have the bottom of the text cut off in each row how would I do this?
View 2 RepliesMaybe I'm googling for the wrong thing but I can't find anything on this.
How can I change the line height of a Label element in Flex?
I have two labels in a VBox and there is quite a lot of white space between them which I would like to reduce. There's no line height property and setting the height property causes overlap.
Is there a way, for a Button's "label" field, to display text over several lines? Or else to automatically "wrap" the text in several lines instead of cutting part of it?
View 4 RepliesI'm trying to remove all line breaks from the text that is pasted into the Spark TextArea.
I have:
<s:TextArea id="inputSearchQuery"
width="100%" height="22"
[code].....
How to set a Spark List height to the height of its content?Tried this:
var lastRow:IVisualElement =
myList.dataGroup.getElementAt(myList.dataGroup.numElements - 1);
myList.height = lastRow.y + lastRow.height;
It works in case of a single item, but lastRow is null in case of more items.
I would like to add some fancy drawing beyond the CSS formatting. How can I put a skin on a spark Label ?
View 1 RepliesI need to set the text of a spark label and then position such label along the x axis depending on its width. Unfortunately, it seems that the width of the label does not update right away and thus the positioning will fail. I can listen to updateComplete events on the label and update its position then, but that means repositioning the label a lot more often than I would like (updateComplete fires off a lot more often than upon changing width). how to properly handle what would appear to be a trivial task?
Here's a code snippet that shows what I described above. If you press the button you will see 3 traces: the label width before changing its text, right after setting its text, and when the label is done updating itself. Would love to know if there's a way to get the correct width without having to listen to updateComplete events... The button and the VGroups are just there to run the example
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[Code].....
[Code]....
The follow code seems not to working ( Flex 4.5 ). What could cause this issue, and how to fix it ?
I have a group of spark label components within a VGroup. Is there a way to change the background color to the labels when the user rolls over them? I've tried adding rollOverColor to the VGroup, but it didn't work.
View 1 RepliesI'm creating the Label component like this
var label:Label = new Label();
label.text = "some text";
label.styleName = "someStyle";
addChild(label);
But it stay invisible until I explicit set the width and height.How can I make the label to be auto resized according to it's text?
I've got a spark buttonbar w/ a dataprovider as follows:[code]By default, the button's labels will be "Dave" and "Brenda", respectively. How can I dynamically change the label to the "addr" field when a user rolls over the button?
View 1 RepliesAmong all the options of the spark label, there is none that tells me the last character shown when the text is truncated, is there any way to accomplish this?
View 1 RepliesFirst of all I know there is a spark VolumeBar component but, for design requirements I can't use it..
I'm trying to create a custom component but heights are not responding as should. [Update] This is were I call the class
<components:VolumeSlider steps="4" height="100" /> The problem is that the volume slider is adapting perfectly, but My custom items component doesn't.
[Code]...
i have the following code:
<s:ButtonBar id="tabs" y="15" left="0" height="31"
change="VideosMenuBar_changeHandler(event)" requireSelection="true">
<s:layout>[code].........
how can i change the height of the buttons in this buttonbar?? is it possible without extra skin class?
I want my list control has its content height as I don't want scroll bars. For the scrolling purpose I have my own scroller in parent container.
Now, The problem is when list control exceeds the maxHeight 10000, then it will start clipping remaining data. I think the solution is increase the maxheight.
how I can set maxheight more than 10000.
For Example..
</s:Scroller width="100%" height="100%">
</s:VGroup>
<s:List id="myList" dataProvider="arrData" useVirtualLayout="false" />
</s:VGroup>
</s:Scroller>
In this case assume that I have arrData.length = 9999999, and for that mylist's height will become 10000+ (Lets assume 15000). now mylist will clipped after 10000px height or list's vertical scrollbar will visible and as I adready have scroller of my own It will have two scrollbars at that particular time.
How to create horizontal layout container like HGroup but with border and border radius?In this example there is some default height:
<s:BorderContainer width="100%" borderWeight="2" cornerRadius="5">
<s:layout>
<s:HorizontalLayout/>
[code]....
I want it to have height of the heighest element in container. Like in HGroup. Add: Why is height for above example BorderContainer equal to 112 ?
I have been given the seemingly simply task of resizing a Group container by setting width and height explicitly in response to user interaction. However, changing these values have no effect on the size of the container at all. Changing scaleX and/or scaleY will change the size of the container just fine, but this is not the behavior I am after.I have tried overriding updateDisplayList() to set a specific width and height, but this has not yielded the desired results.
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="ns.adobe.com/mxml/2009" ;
xmlns:s="library://ns.adobe.com/flex/spark"
[code]......
I'm creating a log-in box for my Flex application. However, I'm required to apply a specific design to this box that I have to change the title bar height.
The component I'm using is spark.components.Panel. I just can't find the property of this 'Panel' component to change the feature.
How can you display a multi-line column header using the Flex Spark Data Grid for Flex 4.5?
View 5 RepliesI know this question has been asked before but the other solutions didn't work for me quite well. here's my sample application.
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[code].....
I want to get the line count of the spark text area content.
View 1 RepliesI'm drawing an arrow as a <s:Path> and I need to get notified when the mouse is over it. How can I do that?
The arrow is an element of a Group container.
I tried registering for MOUSE_OVER events for both the container and the arrow and none seem to fire...
The old method for the mx:TextArea no longer works. Specifically:
myMxTextArea.verticalScrollPosition = myMxTextArea.maxVerticalScrollPosition;
I've found this method for Spark but seems a bit kludgy:
mySparkTA.scrollToRange(mySparkTA.text.length-1, mySparkTA.text.length);
Is there a more straightforward way to do this?