PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, July 28, 2022

[FIXED] How to auto center crop ImageView Android?

 July 28, 2022     android, crop, imageview     No comments   

Issue

I made a listView images. My goal that each item of my listView have the same height of 100dp. I encounter a problem that my imageView is resized automatically, but does not take the entire space of the parent.

Here is my current result and objectif result :

Resized Image objectif

Does anyone know the option to add to make crop center automatically?


Solution

I am not sure if I understood correctly. It must be either of the two, that you want, I guess.

In your image view set the attribute

android:scaleType="fitXY"

to fit the ImageView completely.

You can choose

android:scaleType="centerCrop"

to crop Center.



Answered By - Naresh
Answer Checked By - Robin (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing