ActionBar.setBackgroundDrawable is stretched, not stretched

I want to set the background of my ActionBar and have it stretchable keeping its aspect ratio until both sizes are greater than or equal to the width / height of the action bar.

By default, it seems to stretch each dimension to fit, so the inference from the drawing is skewed. This is how I do it:

getActionBar().setBackgroundDrawable(
    getResources().getDrawable(R.drawable.my_image));

      

Is there a way to tell the action bar (like ImageView) to use the stretch mode I want?

thank

+3


source to share





All Articles