QML Advanced Tutorial 2

自己写的时候发现圆形背景不透明,

Rectangle {
    id: block
    //width: img.width; height: img.height

    Image {
        id: img
        anchors.fill: parent
        source: "../shared/pics/redStone.png"
    }
}

 

Rectangle 改为 Item就可以了:

Item {
    id: block
    //width: img.width; height: img.height

    Image {
        id: img
        anchors.fill: parent
        source: "../shared/pics/redStone.png"
    }
}

posted on 2011-08-02 14:43  katago  阅读(219)  评论(0编辑  收藏  举报