2014-10-28 43 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 
     }    
    } 
}