What I have currently as follows not working.....
in attrs.xml file
<resources> <attr name="speaker_icon" format="reference"/> <attr name="footer_background" format="reference"/> </resources>
in style.xml file
<resources> <style name="MyTheme" parent="Theme.AppCompat"> <item name="speaker_icon">@drawable/speaker_icon_dark</item> <item name="footer_background">@color/footer_background_dark</item> </style> <style name="MyTheme.Light" parent="Theme.AppCompat.Light"> <item name="speaker_icon">@drawable/speaker_icon</item> <item name="footer_background">@color/footer_background</item> </style> </resources>
in my layout.axml file
<?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize" app:background="?attr/footer_background"> <RelativeLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center"> <LinearLayout android:layout_height="wrap_content" android:layout_width="wrap_content" android:orientation="vertical" android:layout_alignParentLeft="true"> <ImageView android:id="@+id/footer_ImageviewSpeakers" android:layout_width="wrap_content" android:layout_height="25dp" android:layout_gravity="center" android:adjustViewBounds="false" app:src="?attr/speaker_icon" android:contentDescription=""/> </LinearLayout> </RelativeLayout> </android.support.v7.widget.Toolbar>
app:background="?attr/footer_background"
in root working fine but, in app:src="?attr/speaker_icon"
in ImageView not working. It shows build error.
attribute src (aka com.xxx.abc:src) not found.
Answers
Please change
attrs.xml
file like following code format.Xamarin forums are migrating to a new home on Microsoft Q&A!
We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
For more information, please refer to this sticky post.
Nothing changed, got the same error. Please help me. Stuck here for almost 2 days.
If I change

app:src="?attr/speaker_icon"
toandroid:src="?attr/speaker_icon"
it will also give me runtime error like below.Did you try it about all of my code?
Yes, your demo app works fine. But, same code show the above runtime error from my project. Do you have any idea why it show that error?
You can try to open your project folder. Delete bin and obj folder, then rebuild your project, if you have same issue. If you still have this issue, due to cannot reproduce your issue. Could you share a demo?