为什么在android中更改键盘视图后无法更新视图?

时间:2019-04-30 04:00:47

标签: android kotlin view keyboard

我想上传键盘视图,但不会更改和更新键盘视图

这是我的情况

enter image description here-> enter image description here

这是我的代码

        var keyboardKor: Keyboard? = null
        var keyboardShift: Keyboard? = null
        var keyboardView: KeyboardView? = null

        override fun onCreateInputView(): View {
             val keyboardContainer = 
             layoutInflater.inflate(R.layout.keyboard_view, null) as RelativeLayout
             keyboardView = keyboardContainer.findViewById(R.id.keyboard) as KeyboardView
             keyboardView?.setOnKeyboardActionListener(this)
             keyboardView?.keyboard = keyboardKor

              btn.setOnClickListener { 
                  changeKeyboardView()
              }

             return keyboardContainer
         }

          fun changeKeyboardView() {
              keyboardView?.keyboard = keyboardShift
          }

我想在单击按钮时更新键盘视图!

请我的朋友

0 个答案:

没有答案