2017-06-13 79 views
2

我有使用roPinEntryDialog Roku機上的應用程序,就像這樣:是否可以顯示在roPinEntryDialog中輸入的數字?

function EnterCode() as Boolean 
    screen = CreateObject("roPinEntryDialog") 
    mp = CreateObject("roMessagePort") 
    screen.SetMessagePort(mp) 
    screen.SetNumPinEntryFields(8) 
    screen.SetTitle("Enter Code") 
    screen.AddButton(0, "Next") 
    screen.AddButton(1, "Cancel") 
    screen.Show() 

    while true 
     msg = wait(0, screen.GetMessagePort()) 
     if type(msg) = "roPinEntryDialogEvent" 
      print "Show Code: Index: ";msg.GetIndex();" Data: ";msg.GetData() 
      if msg.isScreenClosed() 
       return false    
      else if msg.isButtonPressed() 
       token=screen.Pin() 
       print "token: ";token 
       if msg.GetIndex() = 0 then return true 
       if msg.GetIndex() = 1 then return false 
      endif 
     endif 
    end while 
end function 

當我使用這個對話框,它顯示了輸入的數字爲星號。我試過使用,screen.SetSecureText(false),但不幸的是,這隻適用於文本框。有沒有辦法顯示輸入的數字?如果沒有,是否有另外的數字對話框,我應該嘗試這樣做?

回答

2

Roku在這裏工作。

卡西迪,請注意,old SDK1 visual screen components are actually deprecated和包含的組件將導致渠道更新失敗我們的認證截至2018年1月。此外,組件將在第二年從固件本身中刪除。 roPinEntryDialog包含在不推薦使用的組件列表中。

雖然仍然需要使用SDK1 UI提交頻道更新,但您最終必須更新SceneGraph中的UI。鑑於您已經在使用頻道,現在可能是轉換頻道的理想時間。

如上所述,我建議使用PinPad,PinDiaglog,Keyboard或KeyboardDialog節點。如果你確實習慣於使用舊的SDK1模型,那麼你可以使用roKeyboardScreen,但你可能會冒用戶輸入字母和數字的風險。

+0

謝謝!是的,不幸的是,在這個特殊的項目中,我無法使用SceneGraph。這就是我所需要的,我只是使用常規鍵盤並使用正則表達式進行驗證。謝謝! –

0

roPinEntryDialog不支持。如果您正在編寫SceneGraph應用程序,則可以使用PinPad小部件或MiniKeyboard

+0

不幸的是,我使用的是舊版本的Roku dev,它必須使用BrightScript和不使用SceneGraph來完成。 –

相關問題