0

私はコロナが初めてで、sqlite とテキストが折り返されず、他のテキストの上に表示されないという問題があります。sqlite テーブルには、名前、電話番号、コメントの 3 つの列が含まれています。コメント欄は非常に長くなる可能性があり、折り返されています。以下は私が使用しているコードです。どんなアイデアでも大歓迎です。

--setting the font size & text display size
local fSize = display.contentWidth * .03
local tTab = display.contentWidth * .05
local tWidth = display.contentWidth * .9
local 

tTop = display.contentHeight * .1


local count =0
local sql = "SELECT * from contacts"
for row i

n db:nrows(sql) do

if row.name == nil then
    print(" NO NAME FOUND!!! ")
end

count = count +1
local dbText = row.name.." - "..row.phone.." - "..row.comment
local t = display.newText(dbText, tTab, tTop + ((fSize * 1.25) + (fSize * 1.25 *        
count)), tWidth, 0, native.systemFont, fSize)
t:setTextColor(255,255,255)

end
4

1 に答える 1

0

このようにしてみてください...

local ypos= 50
for row in db:nrows(sql) do

if row.name == nil then
 print(" NO NAME FOUND!!! ")
end

count = count +1
local dbText = row.name.." - "..row.phone.." - "..row.comment
local t = display.newText(dbText, tTab, ypos, tWidth, 0, native.systemFont, fSize)
ypos=t.y+ypos+30
t:setTextColor(255,255,255)

end
于 2013-11-18T11:56:05.217 に答える