上native.newTextFieldの向きを修正するためにどのように私たちのアプリは、portrait
をサポートし、私たちは手動でいくつかのオブジェクトを回転させているが、我々はここでは、このnative.newTextField
回転
-- setupTextField
function setupTextField()
local txNameBG = display.newImageRect("images/login/login-input-bg.png", 225, 30)
txNameBG.x = _gameCenter.x
txNameBG.y = _gameCenter.y
sceneGroup:insert(txNameBG)
_events.fixRotate(txNameBG)
if (txName == nil) then
txName = native.newTextField(_gameCenter.x, _gameCenter.y, 225, 30)
txName.hasBackground = false
txName.inputType = "default"
txName.placeholder = "INSERT NAME"
txName.align = "center"
txName.font = native.newFont(native.systemFont, 15)
txName:setTextColor(163, 25, 12)
txName:addEventListener("userInput", _events.textListener)
sceneGroup:insert(txName)
-- _events.fixRotate(txName)
end
end
で株価あることは、我々が使用している機能ですオブジェクトを回転させるためのもの(ネイティブ。*のみ)は応答しません。
eventClass.fixRotate = function (obj)
obj:rotate(90)
obj.isFixedRotation = true
-- obj.angularVelocity = 0
end
これは、これは(
landscapeRight
)を回転した後に起こるものであり、正しいレイアウトであるが、native.newTextField
内のテキストを切断し、
どうすればこの問題を解決できますか?
回転でも幅と高さを入れ替えることはできますか? – Amir
いや、私はちょうどオブジェクトを回転させた..私は、高さと幅を交換する必要はないと思います。他のオブジェクトが完全に反応し、そしてなぜ私は唯一 'portrait'の向きをサポート – 0yeoj
ことにより、私は、ファイルをお願いすることができますこれに関するバグレポート?問題を示す小さなアプリを作ってください。アプリには、main.lua、config.lua、build.settingsファイルと、アプリをビルドして実行するために必要なすべてのアセットが含まれている必要があります。 .zipファイルのそれを入れて、訪問:https://developer.coronalabs.com/content/bug-submission –