TextView的ems和MaxLength


<EditText
android:id="@+id/et_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:ems="1"//EditText的寬度為一個中文的寬度即2個字符的寬度
android:maxLength="4"//最大可輸入4個字符
android:text="8633"
android:textColor="@color/textColor"
android:textSize="14sp" />

//所以這里只能看得到86顯示,33被遮住了,也不能再輸入了
//中文就只顯示一個1中文

 

 
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM