有没有办法以编程方式添加并在用户点击的TextView
旁边显示它?ImageView
我尝试了这样的事情,但没有结果,TextView
被添加到我的布局底部:
TextView score = new TextView(getBaseContext());
score.setText("Image clicked");
Rect rectf = new Rect();
im.getLocalVisibleRect(rectf);
AbsoluteLayout.LayoutParams params = new AbsoluteLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT, 300, 270);
score.setLayoutParams(params);
layout.addView(score);