我有一个扩展Dialog的自定义组件。我使用自定义数组添加按钮,我只有1个按钮
m.buttonGroup = m.top.buttonGroup
m.buttonGroup.maxWidth = 50
m.buttonGroup.minWidth = 50
buttonLabels = []
buttonLabels.push("Some Button")
m.top.buttons = buttonLabels
当显示此对话框时,按钮的宽度几乎占用了所有可用宽度,显然不是50,因为它已定义。
我也尝试过添加按钮但没有运气。有任何想法吗?
谢谢!
答案 0 :(得分:0)
<Poster
id="noButtonContainer"
uri="pkg:/images/no_btn.png"
width="328"
height="53"
translation="[65,250]" />
<Poster
id="yesButtonContainer"
uri="pkg:/images/no_btn.png"
width="328"
height="53"
translation="[431,250]" />
<ButtonGroup id="yesNoButton" layoutDirection="horiz" minWidth="328" itemSpacings="[38, 0]" translation="[65,250]" >
<Button
id="noButton"
focusBitmapUri="pkg:/images/yes_btn.png"
iconUri=""
focusedIconUri=""
height="55"
textFont="font:MediumSystemFont"
focusedTextFont="font:MediumBoldSystemFont"
text=" NO"/>
<Button
id="yesButton"
focusBitmapUri="pkg:/images/yes_btn.png"
iconUri=""
focusedIconUri=""
height="55"
textFont="font:MediumSystemFont"
focusedTextFont="font:MediumBoldSystemFont"
text=" YES"/>
</ButtonGroup>