Hello ozkaro,
Welcome to our Microsoft Q&A platform!
To change the background color programatically, try to get the shape drawable and then use SetTint
to change the color value.
Check the code:
//layout.xaml
<TextView
android:id="@+id/text"
android:background="@drawable/custom_shape"
android:text="testing..."
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
//change the background
var text = FindViewById<TextView>(Resource.Id.text);
Drawable background = text.Background;
background.SetTint(Resource.Color.colorAccent);
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.