如何在Android中创建TextArea [英] How to create a TextArea in Android

查看:77
本文介绍了如何在Android中创建TextArea的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为我的android项目显示TextArea?在xml中,唯一的选择是多行文本字段.但是,那是可编辑的.我需要一个仅用于显示消息的TextArea/用户无法编辑/输入文本.

How do I display a TextArea for my android project? From xml, the only choice is TextField, multi lined. But thats editable. I need a TextArea which is only for displaying messages/text can't be edit/input by the user.

推荐答案

这真的很简单,用XML编写此代码:

Its really simple, write this code in XML:

<EditText
    android:id="@+id/fname"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:hint="First Name"
/>

这篇关于如何在Android中创建TextArea的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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