2
Android의 PopupWindow
에있는 TextView
의 텍스트를 동적으로 변경하는 데 문제가 있습니다. LayoutInflater
및 ViewGroup
을 사용하여 PopupWindow
내부의 TextView
요소를 참조했지만 텍스트가 업데이트되지 않습니다. 어떤 도움이라도 대단히 감사하게 될 것입니다! :)PopupWindow의 TextView 텍스트가 작동하지 않습니다.
내 코드는 다음과 같다 :
private void popupWindow() {
try {
LayoutInflater inflater = (LayoutInflater) SwingSpeed.this
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.popup_recording,
(ViewGroup) findViewById(R.id.popup_element));
pw = new PopupWindow(inflater.inflate(R.layout.popup_recording,
null, false), 480, 800, true);
pw.showAtLocation(findViewById(R.id.swingspeed), Gravity.CENTER, 0,
0);
recording_text = (TextView) layout
.findViewById(R.id.recording_text);
recording_text.setText("Recording"); //Update the TextView
} catch (Exception e) {
e.printStackTrace();
}
}
우수합니다. 정말 고맙습니다!! – BGM