无法解析 android.support.v7.internal.widget.TintImageView
Canot resolve android.support.v7.internal.widget.TintImageView
我尝试将项目中的 compileSdkVersion 设置为 23,并更新了以下库:
com.android.support:appcompat-v7:23.1.1
com.android.support:recyclerview-v7:23.1.1
com.android.support:cardview-v7:23.1.1
从那以后我在导入时遇到错误 android.support.v7.internal.widget.TintImageView
谁能告诉我为什么会这样? TintImageView 的包有什么变化吗?请帮忙。
我正在使用 Studio Preview 2.0
它发生 因为 class
android.support.v7.internal.widget.TintImageView
appcompat v 23.x.x中不存在。
通常不要使用 internal
包中的 classes。
您可以在文件夹androidsdk\extras\android\m2repository\com\android\support\appcompat-v7\
中查看源代码。
您应该切换到 AppCompatImageView
。
A ImageView which supports compatible features on older version of the platform, including:
- Allows dynamic tint of it background via the background tint methods in ViewCompat.
- Allows setting of the background tint using backgroundTint and backgroundTintMode.
This will automatically be used when you use ImageView in your layouts. You should only need to manually use this class when writing custom views.
用这个给 ImageView
着色:
<android.support.v7.widget.AppCompatImageView
android:id="@id/imageview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/my_image"
android:tint="#636363"
/>
我尝试将项目中的 compileSdkVersion 设置为 23,并更新了以下库:
com.android.support:appcompat-v7:23.1.1
com.android.support:recyclerview-v7:23.1.1
com.android.support:cardview-v7:23.1.1
从那以后我在导入时遇到错误 android.support.v7.internal.widget.TintImageView
谁能告诉我为什么会这样? TintImageView 的包有什么变化吗?请帮忙。
我正在使用 Studio Preview 2.0
它发生 因为 class
android.support.v7.internal.widget.TintImageView
appcompat v 23.x.x中不存在。
通常不要使用 internal
包中的 classes。
您可以在文件夹androidsdk\extras\android\m2repository\com\android\support\appcompat-v7\
中查看源代码。
您应该切换到 AppCompatImageView
。
A ImageView which supports compatible features on older version of the platform, including:
- Allows dynamic tint of it background via the background tint methods in ViewCompat.
- Allows setting of the background tint using backgroundTint and backgroundTintMode.
This will automatically be used when you use ImageView in your layouts. You should only need to manually use this class when writing custom views.
用这个给 ImageView
着色:
<android.support.v7.widget.AppCompatImageView
android:id="@id/imageview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/my_image"
android:tint="#636363"
/>