Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to reference a selector from a style

$
0
0

Hi,

I have the following style:

<style name="Theme.CoverageButton" parent="android:style/Widget.ImageButton">
    <item name="android:layout_width">150dp</item>
    <item name="android:layout_height">150dp</item>
    <item name="android:layout_gravity">center</item>
    <item name="android:adjustViewBounds">true</item>
    <item name="android:scaleType">fitCenter</item>
    <item name="android:background">@drawable/SelectorButton</item>

  </style>

When building the line "@drawable/SelectorButton" throws a No Resource Found error.

However, if I add "android:background="@drawable/SelectorButton" directly to the ImageButton in the layout it works fine.

Is there something else I am missing when trying to set the background selector from the style?

Thanks in advance.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>