是否有可能以多行输入类型作为Android的EDITTEXT多少? [英] is it possible multiline with input type as number in Android Edittext?

查看:111
本文介绍了是否有可能以多行输入类型作为Android的EDITTEXT多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在了Android的EditText输入类型是数字,是有可能使多线?
我曾尝试在XML文件下面。

When the android edittext input type is number, is it possible to make multilines? I have tried with the following in xml file.

的android:inputType下=号| textMultiLine

android:inputType="number|textMultiLine"

但它没有工作。这难道不是可能使多行,当输入类型是多少?

But it did not work. Is it not possible to make multiline when the input type is number?

请帮我在这。
谢谢你。

Please help me in this. Thank you.

推荐答案

我想每一个解决方案,为您的problem.The的事情是,当您尝试使用的android:inputType下数量 Android的多年平均值为 textMultiLine 功能对于users.it是可能的只有一个属性即的android:数字=整数。我知道<强>的这是德precated 的但是对于你的问题的这是唯一的解决方案

I tried each and every solution for your problem.The thing is that when you try to use android:inputType attribute with number android doesnot provide textMultiLine feature for users.it is possible with only one attribute i.e., android:numeric="integer".I know that it is Deprecated but for your problem this is the only solution.

我做了一个示例XML file.it如下:

I have made a sample xml file.it is as follows:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <EditText
        android:id="@+id/editText2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:gravity="top"
        android:lines="10"
        android:numeric="integer" />

    <EditText
        android:id="@+id/editText3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:maxLines="10"
        android:numeric="integer" />

    <EditText
        android:id="@+id/editText4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:maxLines="10"
        android:numeric="integer" />

</LinearLayout>

有与解释用样品的EditText如下: -

There are sample EditText used with explanation as follows:-

第一个介绍的TextView为究竟这几行通过使用属性 - Android的身材:线条=10。这里如果你DONOT提供的的android:比重=顶,然后你将从中的EditText在中心启动任何输入

The first one describes the TextView be exactly this many lines tall by using the attribute-android:lines="10".Here if you donot provide android:gravity="top" then any input you do will start from the center of the EditText.

第二个介绍的TextView为最多这几行用高大属性 - 的android:MAXLINES =10

The second one describes the TextView be at most this many lines tall by using the attribute-android:maxLines="10".

我希望你将最终竭诚为您的问题被成功解决了。

I hope you will finally be happy for your problem being solved successfully.

这篇关于是否有可能以多行输入类型作为Android的EDITTEXT多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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