enter image description here 这就是我要创建的。可渲染的视图,允许用户输入文本并上传。
这是我当前的代码,该按钮可以正常工作,但是EditText无法调用键盘和输入文本。这个问题有解决方案吗? 预先感谢。
private void addInfoCard(Node flag) {
Node infoCard = new Node();
infoCard.setParent(flag);
infoCard.setLocalPosition(new Vector3(0f, 0.25f, 0f));
ViewRenderable.builder()
.setView(this, R.layout.description_card)
.build()
.thenAccept(
(renderable) -> {
infoCard.setRenderable(renderable);
EditText mContent = (EditText) renderable.getView().findViewById(R.id.card_content);
Button mUploadBtn = (Button) renderable.getView().findViewById(R.id.card_upload);
mUploadBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d(TAG, "Content is"+mContent.getText().toString());
mUploadBtn.setVisibility(View.INVISIBLE);
}
});
})
.exceptionally(
throwable -> {
Toast toast = Toast.makeText(this, "Unable to load andy renderable", Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
return null;
});
}