使用 MaskedEditText 时出错

Errors while using MaskedEditText

我正在尝试对 phone 号码使用 MaskedEditText。 这是 xml 代码:

 <br.com.sapereaude.maskedEditText.MaskedEditText
    android:id="@+id/phone"
android:inputType="number"
    android:layout_width="200dp"
    android:layout_marginTop="10dp"
    android:layout_height="wrap_content"
    android:hint="Phone number"
    app:met_mask="+## (###) ### ## ##"
android:maxLength="13"
    android:textAlignment="center"
    android:textSize="20dp"
    />''

我添加的分数:

implementation 'ru.egslava:MaskedEditText:1.0.5'

错误是:

error: attribute met_mask (aka com.example.app2:met_mask) not found. error: failed linking file resources.

请帮帮我!

根据您使用的库https://github.com/egslava/edittext-mask

<br.com.sapereaude.maskedEditText.MaskedEditText
android:id="@+id/phone_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="phone"
android:typeface="monospace"
mask:allowed_chars="1234567890"
mask:mask="+7(###)###-##-##"
android:hint="1234567890"
app:keep_hint="true"
/>  

您正在使用 属性:

app:met_mask="+## (###) ### ## ##"

但图书馆允许:

  mask:mask="+7(###)###-##-##"

所以,请按规定使用。

希望有用!!!