2016-08-10 22 views
3

有人知道#attribute值在這個XML文件中的含義是什麼?什麼是maxLength =「#長度」意味着在一個xml的android佈局文件?

<EditText 
       android:id="@+id/firmaText" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerVertical="true" 
       android:ems="8" 
       android:textColor="@color/black" 
       android:textSize="14sp" 
       android:paddingLeft="5sp" 
       android:inputType="textPassword" 
       android:lines="1" 
       android:maxLength="#{longitud}" 
       android:text="#{pin}"/> 

我知道maxLength屬性的含義和用法,問題在於它的值。

我也覺得是一種預處理的,但是,它不編譯...

+0

初步搜索谷歌 –

+0

可能是一種預處理? –

+0

我已經在谷歌上搜索過它。 – Baima

回答

0

解決,這是圖書館的語法錯誤。

感謝所有。

0

機器人:最大長度

設置一個輸入濾波器,以限制文本長度爲指定的數。

必須是整數值,例如「100」。

例如:android:maxLength =「6」將EditText的長度限制爲6個字符。

這也可能是對資源(形式爲「@ [package:] type:name」)或主題屬性(形式爲「?[package:] [type:] name」)的引用,其中包含這種類型的值。