I am testing sliding to load images into my project.
I created the following layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <ImageView android:id="@+id/imageview" android:background="#550000ff" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout>
When I load an image using imageView.setImageResource(int) , it loads correctly (see screenshot below)
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ImageView imageView= (ImageView) findViewById(R.id.imageview); imageView.setImageResource(R.drawable.pen_logo); }

But when I load it with a slide, the image expands, ignoring the wrap_content options:
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ImageView imageView = (ImageView) findViewById(R.id.imageview); Glide.with(this).load(R.drawable.pen_logo).into(imageView); }

How can I solve this problem?
Addev source share