ZBLOG

在 Duilib 中,要设置 Option 控件距离左边框一定的宽度,可以通过调整其 x 属性来实现。你可以在每个 Option 标签中添加一个 x 属性,设定其值为 10(或者你想要的其他值)。以下是你的代码示例,修改后的版本:

<VerticalLayout height="560" bordersize="1" width="210" bordercolor="#00DCDCDD">
   <Control height="2" />
     <Option group="quickbar" normalimage="settingbtn\changgui_nor.png" float="false" hotimage="settingbtn\changgui_hot.png" selectedimage="settingbtn\changgui_hot.png" name="commonopt" height="30" width="200" x="10"/>
     <Option group="quickbar" normalimage="settingbtn\tuisong_nor.png" float="false" hotimage="settingbtn\tuisong_hot.png" selectedimage="settingbtn\tuisong_hot.png" name="movement" height="30" width="200" x="10"/>
     <Option group="quickbar" name="topgrade" height="30" width="200" normalimage="settingbtn\gaoji_nor.png" float="false" hotimage="settingbtn\gaoji_hot.png" selectedimage="settingbtn\gaoji_hot.png" x="10"/>
     <Option group="quickbar" name="address" height="30"
            width="{your_width}" normalimage="{your_image_path}" 
            float="{your_float}" hotimage="{your_hover_image_path}" 
            selectedimage="{your_selected_image_path}" 
            x="{desired_x}"/>
     <Option group='quickbar' name='communpwd' height='30' width='200'
            normalimage='settingbtn\tongxun_nor.png' float='false'
            hotimage='settingbtn\tongxun_hot.png' selectedimage='settingbtn\tongxun_hot.png' x='10'/>
     <Option group='quickbar' name='loginpwd' height='30' width='200'
            normalimage='settingbtn\denglu_nor.png' float='false'
            hotimage='settingbtn\denglu_hot.png' selectedimage='settingbtn\denglu_hot.png' x='10'/>
     <Option group='quickbar' name='aboutbtn' height='30'
             width='{your_width}' normalimage='{your_image_path}' 
             float='{your_float}' hotimage='{your_hover_image_path}' 
             selectedimage='{your_selected_image_path}' 
             x='{desired_x}'/>
     <Control height=\"2\"/>
</VerticalLayout>

请注意,这里使用了 x=“10” 来设置每个选项控件离左边框的距离。你可以根据需要调整这个值。


内容由零声教学AI助手提供,问题来源于学员提问

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=19465

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?