每次运行应用程序时,都会收到错误"Android资源链接失败"。
我有不同的对象,对于所有这些对象,我都收到错误:
C:\Users\Samuel\AndroidStudioProjects\Carlschwein\app\src\main\res\layout\activity_main.xml:38: 错误:属性met_singleLineEllipse(又名 com.example.carlschwein:met_singleLineEllipse( 未找到。
问题似乎是应用程序:met_singleLineEllipse="true",但我必须保留它,我找不到任何可能对我有帮助的相关文档。
XML 文件一:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
app:cardElevation="4dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.rengwuxian.materialedittext.MaterialEditText
android:id="@+id/edtNewUser"
android:hint="User name"
android:textColorHint="@color/colorPrimary"
android:textColor="@color/colorPrimary"
android:textSize="24sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:met_baseColor="@color/colorPrimary"
app:met_floatingLabel="highlight"
app:met_primaryColor="@color/colorPrimary"
app:met_singleLineEllipse="true"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
XML 文件二:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
tools:context="com.example.carlschwein.MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" >
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/info_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
app:cardElevation="4dp"
>
<LinearLayout
android:padding="16dp"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.rengwuxian.materialedittext.MaterialEditText
android:id="@+id/edtPassword"
android:hint="Password"
android:textColorHint="@color/colorPrimary"
android:textColor="@color/colorPrimary"
android:textSize="24sp"
android:inputType="textPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:met_baseColor="@color/colorPrimary"
app:met_floatingLabel="highlight"
app:met_primaryColor="@color/colorPrimary"
app:met_singleLineEllipse="true"
/>
</RelativeLayout>
</android.support.constraint.ConstraintLayout>
任何人都知道为什么会发生这种情况/是我的错误吗?
你试过这个吗(也许只是一个错字(:
app:met_singleLineEllipsis="true"
来自库维基的方法