I want the drawable inside my ImageView to be shown aligned to the bottom (of the Imageview), and not centered.
Is it possible to do that?
Set transparency using setAlpha(float alpha) .
src: src is an attribute used to set a source file or you can say image in your imageview to make your layout attractive.
ImageButton has the same property as ImageView . Only one feature is extra, which is, images set through ImageButton are clickable, and actions can be attached with them upon clicking. Just like a button, the setOnClickListener() can be used to set an event listener for click event on this.
Maybe this is too late, but even I ran into the same problem today and fixed it by using the following snippet.
All the alignment/scaling options are in the scaleType attribute.
Now, if you want to align the image with the beginning of the ImageView, use android:scaleType="fitStart"
.
Similarly, android:scaleType="fitEnd"
to align it with the bottom of the ImageView.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With