Aligning the label in mobileiconitemrenderer

I have a customized item rendered for a list in an application to run on android and am having difficulty getting the 'label' to align in the center.
The code is;
override public function set data(value:Object):void {
if(value != null) {
    super.data = value;
    setStyle("fontSize",18);
if (value.assigned) {
    label = "[ASSIGNED TO YOU]";
    setStyle("textAlign", "center");
else {
    setStyle("color",0xFFFF00);
    label = "[PRESS TO ACQUIRE]";
height = 150;
iconWidth = 75;
iconHeight = 75;
iconFunction = getIcon;
messageFunction = getMessage;
The colors and the fontsize seem to work fine but the label stays aligned left. I have also tried setting the alignment in the List which is the owner of the renderer.   Any ideas?

It sounds like you are using a very early preview release.  MobileIconItemRenderer has been renamed to IconItemRenderer and this seems to work for me the final release of Flex 4.5:
<s:List width="100%">
    <s:dataProvider>
        <s:ArrayList>
            <fx:String>one</fx:String>
            <fx:String>two</fx:String>
            <fx:String>three</fx:String>
        </s:ArrayList>
    </s:dataProvider>
    <s:itemRenderer>
        <fx:Component>
            <s:IconItemRenderer>
                <fx:Script>
                    <![CDATA[
                        override public function set data(value:Object):void {
                            super.data = value;
                            if (!data)
                                return;
                            if (data == 'two'){
                                setStyle('textAlign', 'center');
                    ]]>
                </fx:Script>
            </s:IconItemRenderer>
        </fx:Component>
    </s:itemRenderer>
</s:List>

Similar Messages

  • Align the label of inputText

    How to align the label of inputText to left?
    This is the default alignment of the following components on a panelForm
    15. Total Already Paid: inputText box here
    16. Due for Payment (14-15):     inputText box here
    But I wanted to align them as follow.
    15. Total Already Paid:      inputText box here
    16. Due for Payment (14-15): inputText box here
    Message was edited by:
    V.Piraba

    Thank you Frank. I think my question was not clear. All I need is that I wanted to align the labels of af:inputText to the left and the input text boxes of af:inputText to middle as they are aligned when we put them on af:panelForm.
    Please look at the following format that is how I wanted to display all my inputText.
    Label1 (Short label)---------------------inputText must be here
    Label2 Label2 Label2 (Long label) inputText must be here
    Please note ‘----‘ represents empty spaces between the label and the box
    Message was edited by:
    V.Piraba

  • Can I align the orientatio​n of axis labels in a graph generated with the report generation toolkit (Word)?

    I was wondering how to align the axis labels, i.e. 90 degree or such when creating a graph with the report generation toolkit in word.
    I can do it after the document is created through Format axis title -> alignment but is there a way out of LabVIEW?
    I'd especially like to rotate the y-axis label by 90 degrees.
    Thanks a lot,
    Juergen

    I think he means he can modify it by hand after the report has been generated... But what I want to do is generate the word graph out of labview already with the rotated axis label...
    After I posted this I found out that we can do this with a macro and use it from labview, but unfortunately I don't know VB, or VBA...
    Like this:

  • How can I make the Label go on top of the Text box?

    How can I make the Label go on top of the Text box?
    Thanks again,
    Doug

    Set the Label Horizontal / Vertical Alignment property for the textarea to Above.

  • Flex form layout - add first child vertically aligned with label

    Hi all..
    In flex form layout
    <mx:Form id="form">
            <mx:FormItem label="horizontal:">
                <mx:Text text="test"/>
            </mx:FormItem>
    </mx:Form>
    the output will be
    horizontal 'test'
    But my constraint is i want to align the textbox(first child of the  form item ) vertically with the label. How can i do this ?Any inputs  invited

    Hi,
    You can specify the direction as vertical for FormItem and inside the formitem you can add another text for the header.
    Check the code below.
    <mx:Form id="form">
            <mx:FormItem direction="vertical">
                <mx:Text text="horizontal:"/>
                <mx:Text text="test"/>
            </mx:FormItem>
        </mx:Form>
    Regards,
    Anitha

  • How  to align the customise UILeftBarButton to Left in iOS7

    I have tried aligning the left bar button to the left edge of navigation bar using this code
    "addButton.contentEdgeInsets=UIEdgeInsetsMake(0, 0, 0, 0);"
    but i could not get it to the left instead it get aligned  with extra 10px from left...can anyone suggest a way for that??

    Currently CSS in JFX can't really be used for layout (or sizing). It's one of those grey areas between what is styling (which should be in the CSS) and what is layout (which should be in the FXML). I think I remember Richard once mentioning in a forum or article that he did want to add alignment stuff to the CSS at some point, but don't quote me on that. You could have a search through Kenai to see if there is a feature request for it, and if not add one.
    You could maybe fake it by having the labels stretch to take up the available space in the GridPane. To do this you need to disable the max size restriction (i.e. setMaxWidth and setMaxHeight to Integer.MAX_VALUE) and ensure your GridPane constraints are such that the label will fill the cell. Once you have a stretched label the alignment will come into play as the text is aligned relative to the area of the label (as opposed to a layout manager that aligns the whole label relative to its parent). I find putting a border on the label while debugging useful to work out what is going on.
    Another, more flexible but less contained alternative might be to use variables in your FXML files. You can do this in a number of ways. One is to create a bean that has all your variables on it with getters and then you can pass this to the namespace of your FXML Loader and then reference it using stuff like ${myConstants.gridAlignment}. Another is to create static methods on a class that take a node, these can then be called from the FXML using similar notation to GridPane.alignment. This second approach only works for things where you want to work on the Node directly, but for your scenario that should be ok I think. And then there's always the option to enable a scripting language in your FXML, which allows you to do most anything.
    Hope that helps,
    zonski

  • Aligning textfields, label, and scrollbars in a gridlayout

    Hi,
    I am making an application whose content pane has a null layout. I added a JPanel on the content pane and changed it's layout to gridlayout with 2 columns and 5 rows. I added 1 label, 4 scrollbars and 4 textfields to this. Now I want the Label to be at the top row occupying both the columns and the scrollbars to be aligned on the left side of the gridlayout and textfields on the right side. I used an array to declare my scroll bars and textfields. When I run my application the label, scrollbars and textfields are arranged very haphazardly. Can somebody help me on how to arrange these like i want to?
    Thanx
    Sugar

    Hi!
    Have you considered to use a GridBagLayout ??? Check it out...
    /Andrew

  • How to right align s:Label inside a s:controlBarContent ?

    My spark app has a control bar at the top and i want to right-align a label inside it so my button bar is on the left and my label is on the right. I tried using the 'horizontalAlign="right"' which works find inside a s:panel but not inside a s:controlBarContent. Does anyone have any idea how to achieve this please? Also, the flash builder 4 ide won't let you move the label over in design mode either...
    Thanks for your help,
    Regards,
    Mark.

    I figured it out myself. I added an s:Hgroup around my label and set width="100%" and horizontalAlign="right" you need to set the width to 100% otherwise you're just right aligning within the actual width of the component (which is pretty useless eh?).
    I hope this helps someone else too.
    Regards,
    Mark.

  • How to align avery labels 5267 on my mac

    i neeed to align some labels and they just wont go!!!!!!!!!!!!!!!!!!!!!!!!
    WHAT DO I DO

    You could try a custom paper size and gradually adjust the page length until it prints in the correct location.
    "Although I work for HP, I'm speaking for myself and not on behalf of HP"
    "Say "Thanks" by clicking the Kudos Star in the post that helped you.
    --Please mark the post that solves your problem as "Accepted Solution"

  • JLabel: How to Left Align the text

    Hi.
    I created a JLabel and wanted to left align the text. However, the text is always centered in the frame that contains it. Can you tell me what I need to add to the code?
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Frame.*;
    public class S extends JFrame
         public S()
              setSize(300, 300);
              setTitle("Title Bar");
              setResizable(false);          
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JLabel label = new JLabel("A label", JLabel.LEFT);
              label.setHorizontalAlignment(JLabel.LEFT);           
              label.setToolTipText("Should be left aligned");
              JPanel pane = new JPanel();          
              pane.add(label);
              setContentPane(pane);     
         public static void main(String[] args)
              S f = new S();
              f.show();     
    }Thanks
    Raja

    Read this section from the Swing tutorial on "Using Layout Managers":
    http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html
    Layout Managers layout the components based on rules for each layout manager.
    By default a JPanel uses a FlowLayout. By default FlowLayout aligns components in the center of the space allocated to it. In your case you allocated 300 to the width of the frame, therefore the panel has a width of 300, therefore the label is centered in the 300 pixels.

  • Is there anyway I can make a link on the "value" and not the label (detail form)

    Hi there,
    I have a master-detail form (within an appl) based on 2 real
    tables in a master-detail FK relationship.
    The detail block displays 6 rows. Currently you can only place a
    link on the label on top of the block.
    What I need is to make let's say tha actual value of lastname in
    each row display as a link, something like:
    rec.lastname_value
    I also need to pass the actual ID of that row in the URL used by
    href. I know that you could do it in custom "sql", but do not
    know how to make my form do that.
    Thanks,
    Mariana

    You can look at IE Tab and IE View.
    *https://addons.mozilla.org/en-US/firefox/search/?q=IE%20tab
    *IE View: https://addons.mozilla.org/firefox/addon/ie-view/
    *IE View Lite: https://addons.mozilla.org/firefox/addon/ie-view-lite/

  • What determines whether the Label name and/or Caption appears in the context help window but in other cases, both the label and caption appear in the context help window?

    I am trying to polish an application, and find that I cannot seem to reliably control which of the label or caption text appears in the context help window because I don't understand what rules are in place to determine which should appear. It seems like if I reate a named constant, then use it's right click menu command "Create Indicator" I get a control with only a Label (as long as I don't add a caption). This then appears in the context help window as the label name followed by the description text (after entering some description text). But if I add a caption, the label name is shown in bracket
    s which is a 'feature' I would like to avoid, because I have certain controls where I would like to use a descriptive variable name on the block diagram side without using so much space on the front panel. It seems like there is no way to avoid showing the Label name in the context help for a control/indicator. Is this true?
    I thought the purpose of having a seperate caption was to make the text that appears with a control programmatically controllable, but if that control is not extended to what appears in the context help window, it limits the usefulness of the caption and forces me to re-consider some Label names. However, the problem goes deeper than that because then even when I make the label and caption exactly the same, or if I delete (via a select caption text-backspace or select caption text- delete key .. sequence) the caption for a control, the label name in the context help window still appears in square brackets!
    Can I have complete control over the context help fo
    r a particular control (or has anyone found a third-party context help solution that functions compatibly with LabVIEW 7 in a built application that they will be so kind as to recommend?)
    I have used LabVIEW for three years, and I am now using LabVIEW 7.0.

    Sorry for that.. I was changing the text of my question and didn't read carefully enough in the preview stage. I wanted it to read "What determines whether the Label name and/or Caption appears in the context help window?"

  • Need Help to update the labels in the GUI syncronously - Swing application

    Hello everyone,
    I need some help regarding a swing application. I am not able to syncronously update the counters and labels that display on my Swing GUI as the application runs in the background. But when the running of application is completed, then the labels on the GUI are getting updated, But I want update the labels and counters on the GUI syncronously as the code executes... below I am giving the format of the code I have written..............
    public class SwingApp extends JFrame{
            // here i have declared the label and component varibles like...
                      private JTextField startTextField;
           private JComboBox maxComboBox;
           private JTextField logTextField;
           private JTextField searchTextField;
           private JLabel imagesDownloaded1;
           private JLabel imagesDownloaded2;
           private JLabel imagesDidnotDownload1;
           private JLabel imagesDidnotDownload2;
                      private JButton startButton;
    //now in the constructer.............
    public Swing(){
    //I used gridbaglayout and wrote the code for the GUI to appear....
    startButton = new JButton("Start Downloading");
        startButton.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            try{
                 actionSearch();   //actionSearch will contain all the code and the function calls of my application...........
            }catch(Exception e1){
                 System.out.println(e1);
        constraints = new GridBagConstraints();
        constraints.gridwidth = GridBagConstraints.REMAINDER;
        constraints.insets = new Insets(5, 5, 5, 5);
        layout.setConstraints(startButton, constraints);
        searchPanel.add(startButton);
    //update is a function which initiates a thread which updates the GUI. this function will be called to pass the required variables in the application
    public void update(final int count_hits, final int counter_image_download1, final int didnot_download1) throws Exception{
         Thread thread = new Thread(new Runnable() {
             public void run() {
                  System.out.println("entered into thread");
                  System.out.println("the variable that has to be set is " + count_hits);
                  server_hits_count.repaint(count_hits);
                  server_hits_count.setText( " "+ Integer.toString(count_hits));
                  imagesDownloaded2.setText(" " + Integer.toString(counter_image_download1));
                  imagesDidnotDownload2.setText(" " + Integer.toString(didnot_download1));
                  repaint();
         //this.update(count_hits);
         thread.start();
    //Now in main............................
    public static void main(String[] args){
    Swing s = new Swing();
    s.setVisible(true);
    }//end of main
    }//end of class SwingAbove I have given the skeleton code of my application........ Please tell me how to update the GUI syncronously...
    Please its a bit urgent...............
    Thank you very much in advance
    chaitanya

    First off, note that this question should have been posted in the Swing section.
    GUI events run in a separate thread (the AWT / Event Dispatch Thread) than your program.
    You should be invoking AWT/Swing events via SwingUtilities.invokeLater().
    If for whatever reason you want to have the program thread wait for the event to process
    you can use invokeAndWait().
    http://java.sun.com/javase/6/docs/api/javax/swing/SwingUtilities.html

  • Changing the label of TOC to another language in Captivate 7

    I am using Captivate 7 and created a number of English Projects.  I have translated these English files to French (by exporting/importing captions), changed the voices, etc, etc.  All is now in French in the project except the title of the Table of Contents when enabled.  I have already changed the labels in the table of contents for things such as Slide Title, Duration, etc by creating the TOCStrings.ini file and copying it to my root folder - that works as described in other posts/blogs. However, I am unable to change the Heading/Label of "Table of Contents" to French. 
    Is the TOCStrings.ini file the place to change the label of Table of Contents to French?  If so, what string would I add to the file to make this change happen?
    Can someone please let me know where the change can be made (if not in the TOCStrings.ini) or if the change is even possible? 
    Thank you!

    If you enter data in the Info fields of the TOC, the indicator 'Table of Contents' will automatically be replaced by the Title field.

  • How to make the labels vertical in a horizonal bar chart?

    Hi,
    I am using CF 9.  I have a horizontal bar chart.  How can I make the labels on the Y-Axis display horizontally.  Right now they are vertical and sort of sideways.
    Below is a snipept from my <cfchart>.  Everything is working, I just want the labels to display horizontally.  How can I do this?
    <cfchart
                              format="png"
                              chartheight="310" chartwidth="530" foregroundcolor="##000000"
                              show3d="false"
                              scalefrom="0" scaleto="14"
                              showlegend="no"
                              showxgridlines="yes"
                              showygridlines="no"
                              showborder="no"
                              style="#elementStyle#" >
                              <cfchartseries type="horizontalbar" paintstyle="shade"">
                              </cfchartseries>
    </cfchart>
    Thanks...

    When you open the default New Tab page - about:newtab - which has the Tiles and a Search Bar, the "focus" is in the Search Bar. You could change a hidden setting to have a blank page when you open a new tab if that's what you want - that will have the "focus" in the Location Bar . URL Bar.
    Type '''about:config''' in the URL bar and hit Enter.
    ''Accept the warning''
    Search field at the top to filter with this - '''browser.newtab.url'''
    Right-click the preference that appears below, and select '''Modify'''.
    Insert '''about:blank''' for the new string value.

Maybe you are looking for