如何让多行的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.     />  


原文地址:https://www.cnblogs.com/lby0715/p/4812815.html