1
左邊,我試圖把滾動型到ListView的萊夫特賽德在QML滾動型屏幕的QML
import QtQuick 2.0
import QtQuick.Controls 1.4
Item {
width: 1580
height: 687
Rectangle
{
anchors.fill: parent
color: "Gray"
}
ListModel
{
id: phonecontactsModel
ListElement {
// name :firstname+" "+lastname
firstname:"Alexander"
lastname:"Wurz"
contactimg: "graphics/Phone/contacts/contact_pic1.png"
contactimgSq: ""
phonenum:"02476 000 001"
favstatus:0
}
ListElement{
//name:firstname+" "+lastname
firstname:"Bernie"
lastname:"Ecclestone"
contactimg:"graphics/Phone/contacts/contact_pic1.png"
contactimgSq: "graphics/Phone/contacts/contact_pic1.png"
phonenum:"02476 000 002"
favstatus:1
}
ListElement{
//name:firstname+" "+lastname
firstname:"Bernie"
lastname:"Ecclestone"
contactimg:"graphics/Phone/contacts/contact_pic1.png"
contactimgSq: "graphics/Phone/contacts/contact_pic1.png"
phonenum:"02476 000 002"
favstatus:1
}
ListElement{
//name:firstname+" "+lastname
firstname:"Bernie"
lastname:"Ecclestone"
contactimg:"graphics/Phone/contacts/contact_pic1.png"
contactimgSq: "graphics/Phone/contacts/contact_pic1.png"
phonenum:"02476 000 002"
favstatus:1
}
ListElement{
//name:firstname+" "+lastname
firstname:"Bernie"
lastname:"Ecclestone"
contactimg:"graphics/Phone/contacts/contact_pic1.png"
contactimgSq: "graphics/Phone/contacts/contact_pic1.png"
phonenum:"02476 000 002"
favstatus:1
}
ListElement{
//name:firstname+" "+lastname
firstname:"Bernie"
lastname:"Ecclestone"
contactimg:"graphics/Phone/contacts/contact_pic1.png"
contactimgSq: "graphics/Phone/contacts/contact_pic1.png"
phonenum:"02476 000 002"
favstatus:1
}
ListElement{
//name:firstname+" "+lastname
firstname:"Bernie"
lastname:"Ecclestone"
contactimg:"graphics/Phone/contacts/contact_pic1.png"
contactimgSq: "graphics/Phone/contacts/contact_pic1.png"
phonenum:"02476 000 002"
favstatus:1
}
ListElement{
//name:firstname+" "+lastname
firstname:"Bernie"
lastname:"Ecclestone"
contactimg:"graphics/Phone/contacts/contact_pic1.png"
contactimgSq: "graphics/Phone/contacts/contact_pic1.png"
phonenum:"02476 000 002"
favstatus:1
}
}
ScrollView {
id: id_scrollView
anchors.fill: parent
objectName: "ScrollView"
frameVisible: true
highlightOnFocus: true
ListView
{
height: parent.height
width: parent.width
model: phonecontactsModel
delegate: contacts_delegate
spacing: 6
anchors.left: parent.left
anchors.leftMargin: 360
clip: true
}
}
Component
{
id: contacts_delegate
Item {
id: wrapper
height: 150
width: 1080
Rectangle
{
color: "#99000000"
height: parent.height
width: parent.width -150
}
Image {
width: parent.height
height: parent.height
id: contactImage
source: contactimg
fillMode: Image.PreserveAspectFit
anchors.left: parent.left
}
Text {
id: contactName
text: firstname
anchors.left: contactImage.right
anchors.leftMargin: 70
color: "White"
font.pointSize: 25
anchors.verticalCenter: parent.verticalCenter
}
Image {
id: messageContact
source: "graphics/Phone/messaging_icon.png"
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
}
}
}
}
我不能指定滾動視圖寬度或高度或它的位置的左邊查看我如何才能做到這一點
我想創建這樣的
做這個工作了,你我不能看到滾動條,而我嘗試這樣 –
你可能仍然夾ListView控件,而我把滾動條只需ListView控件之外 - 因此你剪輯的滾動條?或者你只是不喜歡基本的風格...自動消失。 – derM
是的,我現在可以看到他們!我如何剪輯列表視圖?我試圖剪裁滾動條?沒有效果 –