Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Problem styling a Button, cannot assign properties.

$
0
0

Hello, I'm trying to style buttons in my app. I've followed the instructions here:
https://developer.xamarin.com/recipes/android/resources/general/style_a_button/
It works fine if I do exactly as it's explained, in a new project, and put the buttons in a layout axml file, but when I port it to my real app and put the script:

    <Button
        android:background="@drawable/red_button"
        android:id="@+id/button1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Styled Button"
        style="@style/button_text" />

in a regular XAML page it complains that "Cannot assign property "background": Property does not exists, or is not assignable, or mismatching type between value and property", for all the properties.

Why is that?

Thanks.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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