机器人:单线=真不工作的EditText [英] android: singleline = true not working for edittext

查看:78
本文介绍了机器人:单线=真不工作的EditText的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想限制的EditText进入到一个单一的线,但我添加了一行机器人:进入26单线=真正的,提示正在消失,后文字时,光标下来。

下面是我的XML code:

 <的EditText
            机器人:背景=@可绘制/ edittxtborder
            机器人:ID =@ + ID / reglastname
            机器人:单线=真
            机器人:重力=中心
            机器人:提示=@字符串/ reglname
            机器人:TEXTSIZE =12dp
   />
 

解决方案

在你的EditText XML code添加此code。

 安卓ellipsize =终结
 

这会工作。

I want to restrict the edittext entry to a single line but When I add the line android:singleline = "true", the hint is disappears, and after entering 26 characters the cursor is coming down.

Here's my XML code:

   <EditText                      
            android:background="@drawable/edittxtborder"
            android:id="@+id/reglastname"
            android:singleLine="true"
            android:gravity="center"
            android:hint="@string/reglname"
            android:textSize="12dp" 
   />

解决方案

add this code in your edittext xml code.

android:ellipsize="end"

this will work.

这篇关于机器人:单线=真不工作的EditText的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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