多行编辑文本和编辑文本的首字母大写 [英] Multi line Edit Text and first letter capitalization of Edit Text

查看:59
本文介绍了多行编辑文本和编辑文本的首字母大写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我尝试将EditText设置为多行,并且首字母应键入为大写字母,而我正在使用android:inputType="textCapSentences"执行此操作,但在将输入类型设置为textCapSentences后,它将首字母设置为大写字母,但EditText仅是单行.您能帮我把EditText变成多行,加上首字母大写吗?

Hello I am trying to make EditText to multi line and first letter should be type as in capital which I am doing using android:inputType="textCapSentences" but after setting to input type to textCapSentences it set first letter in capital but EditText is single line only. Can you please help me to make EditText to multiline plus first letter should be type in capital

此处为当前EditText

<EditText
    android:id="@+id/commentsEditText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="@dimen/view_vertical_margin"
    android:background="@android:drawable/editbox_background"
    android:inputType="textCapSentences"
    android:gravity="top"
    android:hint="@string/comments"
    android:lines="5" />

推荐答案

您是否尝试过以下代码:-

Have you try below code :-

<EditText
    android:id="@+id/commentsEditText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@android:drawable/editbox_background"
    android:inputType="textCapSentences|textMultiLine"
    android:gravity="top"
    android:hint="@string/comments"
    android:lines="5" />

这篇关于多行编辑文本和编辑文本的首字母大写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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