实现TextView的点击事件,和button十分相似
TextView tv = (TextView) findViewById(R.id.tv_1); tv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(MainActivity.this, "实现点击TextView事件", Toast.LENGTH_SHORT).show(); } });
原文地址:https://www.cnblogs.com/gzyx/p/11712237.html
时间: 2024-10-15 03:40:43