我有下面的代碼顯示有關計算機的信息。將一個組集中到另一個組中
我很難讓s:VGroup出現在s:Group的中心。它總是稍微偏離中心......多到左側和右側。
有什麼辦法可以讓一個小組始終處於其容器的中心嗎?
我試過horizontalAlign =「center」和horizontalCenter =「center」,但都不影響該元素的水平位置。
謝謝!
<s:Group horizontalCenter="center" width="100%" top="10">
<s:Rect x="0" y="0"
radiusX="4" radiusY="4"
height="100%" width="90%" left="10">
</s:Rect>
<s:VGroup top="20" left="20" bottom="20" right="20">
<s:Label id="lblCPU" text="{data.CPU}"/>
<s:HGroup>
<s:Label id="lblmodel" text="{data.model}"/>
<s:Label id="lblmemory" text="{data.memory}"/>
</s:HGroup>
<s:Label id="lblHDD" text="{data.HDD}"/>
<s:Label id="lblUSB" text="{data.USB}"/>
</s:VGroup>
</s:Group>
我經常發現輕微的偏移岬由於邊界。你可以嘗試玩你的標籤邊框(VGroup內),看看它是否有所不同。此外,請嘗試使用閃光燈螢火蟲來查看物體的確切邊界(與眼睛可見的對象相比) – catholicon
僅在我看來_seems_偏離中心,因爲您的bacground Rect不居中(您已將它設置爲10px關閉左側,沒有右側) – RIAstar