一半君的总结纸

听话只听一半君

#22 如何让新加的 control 出现在 UI layout 的顶部而不是底部 (默认是在底部)?

有两种方法:

  1. 使用 formLayout,每次新加controls的时候,重新attach 相应的controls :
    formLayout myForm;
      text1;
      text2;
      text3;
    
    formLayout -e
      -attachForm     text1    top   4
      -attachControl  text2    top   4  text1
      -attachControl  text3    top   4  text2
        myForm;
    
    // 然后..
    
    setParent myForm;
      text4;
    
    formLayout -e
      -attachForm     text4    top   4
      -attachControl  text1    top   4  text4
        myForm;
    
  2. 删除layout的所有children,然后再把他们重新加回去:
    columnLayout myColumn;
      text1;
      text2;
      text3;
    
    // 然后...
    
    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 博主赞过: