java - AdjustViewBounds works for android:src not android:backgound in imageview -


i've got imageview has different images source , background. when use adjustviewbounds , scaletype, works fine on image added in source not 1 in background. how can make work background image too?

<imageview         android:layout_width="199dp"         android:layout_height="112dp"         android:id="@+id/thumbnailsocial"         android:src="@drawable/videopost"         android:background="@drawable/coldplay"         android:layout_marginstart="120dp"         android:layout_marginleft="120dp"         android:layout_margintop="110dp"         android:adjustviewbounds="true"         android:scaletype="centercrop" /> 

try divide background , src image 2 separate view. top view transparent background

<relativelayout     android:id="@+id/thumbnailsocial"     android:layout_width="199dp"     android:layout_height="112dp"     android:layout_marginleft="120dp"     android:layout_marginstart="120dp"     android:layout_margintop="110dp">      <imageview         android:layout_width="match_parent"         android:layout_height="match_parent"         android:adjustviewbounds="true"         android:scaletype="centercrop"         android:src="@drawable/coldplay" />      <imageview         android:layout_width="match_parent"         android:layout_height="match_parent"         android:adjustviewbounds="true"         android:background="@android:color/transparent"         android:scaletype="centercrop"         android:src="@drawable/videopost" /> </relativelayout> 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -