SpunkTrumpet
SpunkTrumpet

Reputation: 131

Resizing bitmap image within imageview

I have an imageview that displays a photo taken with the phone's camera, which can be changed by the user. The problem I'm having is that the picture is scaling too small within the imageview, is there a way to force the bitmap to fit the imageview completely?

Upvotes: 0

Views: 61

Answers (1)

j-maas
j-maas

Reputation: 906

Next time, please search a few minutes, before you ask a question!


In the layout xml-file you have to add the following attributes to your ImageView to make it fill out the view:

android:scaleType="fitCenter"

You can find the attribute in the ImageView documentation's list of XML Attributes. The different scaleTypes can then be found by clicking "android:scaleType" to get to its description.

Upvotes: 2

Related Questions