How to get and set ImageButton background image from code behind in c# Xmarine Android.

soumenhaldersoumenhalder Member ✭✭

How to get and set ImageButton background image from code behind in c# Xmarine Android.

Best Answers

  • TedRogersTedRogers US ✭✭✭✭
    Accepted Answer

    imageButton.SetImageResource(imageResourceId);
    or
    imageButton.SetImageDrawable(imageDrawable);

Answers

  • TedRogersTedRogers USMember ✭✭✭✭
    Accepted Answer

    imageButton.SetImageResource(imageResourceId);
    or
    imageButton.SetImageDrawable(imageDrawable);

  • soumenhaldersoumenhalder Member ✭✭

    @TedRogers said:
    imageButton.SetImageResource(imageResourceId);
    or
    imageButton.SetImageDrawable(imageDrawable);

    Thank you @TedRogers ,
    set ImageButton background image from code behind in c# Xmarine is working fine. Please suggest me how do I GET the background image.
    I need to know which is the current background image of ImageButton control from code behind.

  • soumenhaldersoumenhalder Member ✭✭

    @TedRogers said:
    var bgDrawabke = imageButton.Background;

    Thank you.Working!

Sign In or Register to comment.