0
我在Corona的GridView中顯示圖像,但我不知道GridView爲什麼不滾動。請大家幫我怎麼做?我main.lua文件的代碼和屏幕截圖如下所示Corona的Gridview不滾動
display.setStatusBar(display.DefaultStatusBar)
local widget = require("widget")
local gridView = require("gridView")
local photoArray ={"assets/pic1.png","assets/pic1.png","assets/pic2.png","assets/pic3.png","assets/pic4.png","assets/pic5.png","assets/pic5.png"}
local photoTextArray = {"pic7","pic1","pic2","pic3","pic4","pic5 Long Text Test","pic6"}
gridView:new(25, 50, photoArray, photoTextArray, 2, 10, 20,150, 150, gridListener)
local function gridListener(index)
print("You select item "..index)
end
我已經使用這個鏈接,所以這樣做https://github.com/worldstar/GridView-for-Corona-SDK
在風只是一個刺,但基於代碼,你已經證明你沒有設置scrollwidth和scrollHeight屬性。你需要設置這兩個,因爲它們都是必需的。這決定了你的滾動視圖的大小。當我第一次使用scrollview時,我遇到了同樣的問題。我只是設置寬度和高度,它的工作。這裏是滾動視圖的文檔:http://docs.coronalabs.com/api/library/widget/newScrollView.html – user1597438
哦,右邊的朋友其實我也是新來的電暈和盧阿:) –
嗯,祝你好運你的項目。希望我幫助。 :)保持編碼! – user1597438