2014-10-28 31 views
0

根据translationY的定义:The translation is mostly useful for animations as it doesn't affect the actual laid out position of the visual node. This translation is added after the node has been laid out so it doesn't affect layout in any waytranslationY相当于实际影响布局

是否有任何实际影响视觉节点位置的属性?

我想要的是从顶部边界开始的标签文本。如果我使用translationY,它会触及顶部边框,但标签的大小保持不变。

回答

0

你的问题是薄上的细节,但如果你使用AbsoluteLayoutAbsoluteLayoutProperties成员会影响视觉节点的布局位置,如下QML:

Container { 
    layout: AbsoluteLayout {} 

    Label { 
     text: "Label" 
     layoutProperties: AbsoluteLayoutProperties { 
      positionX: 100 
      positionY: 100 
     }    
    } 
}