QML工作笔记-在Row布局中如何进行稍许移动(图片Row布局会遇到)
生活随笔
收集整理的這篇文章主要介紹了
QML工作笔记-在Row布局中如何进行稍许移动(图片Row布局会遇到)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
目錄
?
演示效果
偽代碼
?
演示效果
意思就是如何把這樣的效果:
改成:
這里并不是把 修仙 上移了,而是把 九州 和 大陸 下移了
這樣的效果!
?
偽代碼
修改后的代碼如下:
Row {id: topRowanchors{top: parent.toptopMargin: 20horizontalCenter: parent.horizontalCenter}Image {id: jiuZhounImagesource: "qrc:/img/loginJiuZhou.png"fillMode: Image.Stretchsmooth: truewidth: loginItem.width * 0.28height: loginItem.height * 0.1anchors{top: parent.toptopMargin: 25}}Image {id: xiuXianImagesource: "qrc:/img/loginXiuXian.png"fillMode: Image.Stretchsmooth: truewidth: jiuZhounImage.width * 1.5height: jiuZhounImage.height * 1.5}Image {id: daLuImagesource: "qrc:/img/loginDaLu.png"fillMode: Image.Stretchsmooth: truewidth: loginItem.width * 0.28height: loginItem.height * 0.1anchors{top: parent.toptopMargin: 25}}}這里主要是依靠anchors中的topMargin這個效果!
?
topMargin也就是把圖片,放在最頂端的25應該是real的位置上。即可
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的QML工作笔记-在Row布局中如何进行稍许移动(图片Row布局会遇到)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Linux学习笔记-消息队列的接收
- 下一篇: Qt笔记-QSerialPort的使用(