我與使用一種稱爲回調功能SQLite數據庫中的數據網格作業時,在本課中描述修復與SQLite數據庫的數據網格變線高度:displaying-large-amounts-of-data如何使用回調
我想對該課程中包含的示例堆棧進行一些更改(您可以從該頁面頂部的鏈接下載堆棧)。
我想顯示在DG而不是電影的情節文本的「標題」的「陰謀」的文字應該有變線的高峯,因爲在這一課描述:how-do-i-create-a-form-with-variable-line-heights
在樣本棧我做了這些變化:
在行模板: 改名場「標題」到「暗算」,設置dontWrap爲false,並改變fixedLineHeight假
改名場「RELEASEDATE」到「NR」
補充說: 把我的領域「NR」來pDataArray [「身份證」]
在行行爲的文字:在設置變量行高度
## changed the layoutControl to make space for wrapping of field "plot"
on LayoutControl pControlRect
local theFieldRect
put the rect of me into theFieldRect
set the right of button "Genre" of me to item 3 of theFieldRect
set the right of field "LblGenre" of me to the left of button "Genre" of me
set the right of field "nr" of me to item 3 of theFieldRect
## Expand field "plot"
put the rect of field "plot" of me into theFieldRect
put item 3 of pControlRect - 180 into item 3 of theFieldRect
set the rect of field "plot" of me to theFieldRect
##Now resize field to fit content
put item 2 of theFieldRect \
+ the formattedheight of field "plot" of me - \
the bottommargin of field "plot" of me \
into item 4 of theFieldRect
set the rect of field "plot" of me to theFieldRect
## Now update the bounding rect to match total height you
## want this row to have
put item 4 of theFieldRect into item 4 of pControlRect
set the rect of graphic "Background" of me to pControlRect
end LayoutControl
在教訓它說轉關閉數據網格的「固定控制高度」。但是,當我這樣做沒有得到顯示,我得到一個腳本錯誤。
帶有我所做更改的堆棧位於:Databases-callbacks-variable-line-height.zip (只需用課程替換課程中的原始堆棧; SQLite數據庫是相同的,應放置在與堆棧相同的文件夾中)。
如何解決這個問題,以便可變的線高度工作?
它現在確定的,但正如你所說的這是非常緩慢的繪製50000個記錄列表 - 花了大約5分鐘。 (!)在一個Android平板電腦,否則很快(只有1100個記錄,它花了7秒,這也是太慢)。所以這種方法是慢的,但是你跟蹤bug是很好的。我想測試這種方法,主要是在我正在開發的應用中比較滾動速度和原生Android滾動條。它有大約700條記錄,正在使用標準LC數據網格,它從製表符分隔的文本文件中獲取其數據....在下一條評論中繼續。 – keram
該應用程序的滾動速度很慢,因此我正在尋找不同的方法來加速並使其更具響應性。如果你有一些時間看我的堆棧(它是自包含的,沒有任何外部文件需要),那麼我會很感激有關如何加快其滾動的任何建議。鏈接到我的應用程序:[DG-only-1.16.zip](https://www.dropbox.com/s/xs0pcrwvh1cc74h/DG-only-1.16.zip) 要測試其數據網格滾動,請點擊「全選「,然後是」行「,然後是」整個選擇「。 – keram
我實際上爲滾動速度問題創建了一個新問題:[scrolling_speed](http://stackoverflow.com/questions/24627756/how-to-increase-the-speed-of-the-native-android-scroller數據網格);我忘記在上面的評論中提到,使用回調功能時,使用這50000條記錄滾動DG會更好。 – keram