如何通过 TextView 获取 EditText 值并在屏幕上显示? [英] How to get EditText value and display it on screen through TextView?

查看:14
本文介绍了如何通过 TextView 获取 EditText 值并在屏幕上显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取 EditText 视图的用户输入,并在单击 Button 时通过 TextView 将其显示在屏幕上.我也想知道可以对 string.xml 文件进行哪些修改来做到这一点.

I want to get the user input for the EditText view and display it on the screen through TextView when the Button is clicked. I also, want to know what modifications can be done on the string.xml file to do this.

推荐答案

我没有得到第二个问题,也许您可​​以详细说明...但是对于您的第一个问题.

I didn't get the second question, maybe you can elaborate...but for your first query.

String content = edtEditText.getText().toString(); //gets you the contents of edit text
tvTextView.setText(content); //displays it in a textview..

这篇关于如何通过 TextView 获取 EditText 值并在屏幕上显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆