zoukankan      html  css  js  c++  java
  • 如何让多行的EditText光标从最前头开始?

    有时我们在做多行EditText的时候会出现光标在中间的问题:

    [java] view plaincopy在CODE上查看代码片派生到我的代码片
     
    1. <EditText   
    2.     android:layout_width="match_parent"  
    3.     android:layout_height="wrap_content"  
    4.     android:minLines="5"  
    5.     android:background="#ffffff"  
    6.     android:paddingLeft="5dp"  
    7.      
    8.     />  


    像这种。

    这是什么原因造成的呢?如何EdittText默认是gravity是center.就是从中间对齐。我们把他改成left啊top啊就OK了。

    [java] view plaincopy在CODE上查看代码片派生到我的代码片
     
    1. <EditText   
    2.     android:layout_width="match_parent"  
    3.     android:layout_height="wrap_content"  
    4.     android:minLines="5"  
    5.     android:background="#ffffff"  
    6.     android:paddingLeft="5dp"  
    7.    <span style="color:#cc0000;">android:gravity="left"</span>  
    8.     />  


  • 相关阅读:
    理解HTTP幂等性
    企业技术树
    数据库MySQL-Oracle-DB2-SQLServer分页查询
    Redis安装教程
    Redis VS Memcached
    Redis简介
    Redis系列文章导读
    坐标轴
    图例
    画网格
  • 原文地址:https://www.cnblogs.com/lby0715/p/4812815.html
Copyright © 2011-2022 走看看