-4

这是单一TextView的,其中包含来自数据库的值。所以我希望当我点击它时,TextView,它应该Toast在我点击的位置显示相同的文本。

显示文本视图的图像

4

1 回答 1

0

这是 TextView显示来自 firebase 的数据的代码。

textView = new TextView(Chat.this);                                                                                                       
textView.setText(message);                                                                                                                  
final Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/fnt1.otf");                                                  

  textView.setTypeface(typeface);                                                                                                             
  LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
  lp.setMargins(0, 0, 0, 20);
  textView.setLayoutParams(lp);
于 2018-10-26T20:07:15.487 回答