一半君的总结纸

听话只听一半君

#22 How can I add a control to the top of a UI layout instead of the bottom (as is the default)?

You have two options:

  1. Use a formLayout and re-attach the controls as you add each to the layout:
    formLayout myForm;
      text1;
      text2;
      text3;
    
    formLayout -e
      -attachForm     text1    top   4
      -attachControl  text2    top   4  text1
      -attachControl  text3    top   4  text2
        myForm;
    
    // and then..
    
    setParent myForm;
      text4;
    
    formLayout -e
      -attachForm     text4    top   4
      -attachControl  text1    top   4  text4
        myForm;
    
  2. Delete all children of the layout and re-add in the desired order:
    columnLayout myColumn;
      text1;
      text2;
      text3;
    
    // and then...
    
    string $children[] = `columnLayout -q -childArray myColumn`;
    for ( $child in $children )
      deleteUI $child;
    
    setParent myColumn;
      text4;
      text1;
      text2;
      text3;
    
Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: