1
Neko에 대한 자습서를 시작했고 필자는 고유 한 특성을 만들고 싶었습니다. 나는 here으로 설명 된 neko에 대한 문서를 따라 왔지만 오류가 계속 발생합니다.Neko에서 NoSuchMethodException을 생성하는 중계 함
더 구체적으로 :
; Clojure code
(ns main
(:use [neko.activity :only [defactivity set-content-view!]]
[neko.threading :only [on-ui]]
[neko.ui :only [make-ui config]]
[neko.ui.traits :only [deftrait]]))
(deftrait :on-text-change
{:attributes [:on-text-change]}
[^android.widget.TextView wdg, {:keys [on-text-change]}, opts]
(.addTextChangedListener wdg (reify android.text.TextWatcher
(afterTextChanged [this _])
(beforeTextChanged [this _ _ _ _])
(onTextChanged [this, s, start, before, count]
(on-text-change (.toString s) start before count)))))
(declare ^android.widget.LinearLayout mylayout)
(def main-layout [:linear-layout {:orientation :vertical, :id-holder true}
[:edit-text {:hint "Event name" :id ::name :on-text-change (fn [text _ _ _])}]
[:edit-text {:hint "Event location" :id ::location}]])
(defactivity MainActivity
:def a
:on-create
(fn [this bundle]
(on-ui
(set-content-view! a
(make-ui main-layout)))))
제작 오류 :
java.lang.NoSuchMethodException : 주 $ eval1159 $ fn__160.invoke에서) $ fn__153 주요 인수에 대한 방법 .SetOnTextChange을 찾을 수 없습니다 (NO_SOURCE_FILE : 4)
아무도 비슷한 문제가 있거나 잘못된 생각을 갖고 있습니까? 미리 제안 해 주셔서 감사합니다.
신속하고 완벽한 답변을 보내 주셔서 감사합니다. 그것은 트릭을했다. – Nathan