Created
May 7, 2011 22:29
-
-
Save romannurik/960912 to your computer and use it in GitHub Desktop.
Center-crop scaling, ala scaleType=centerCrop in Android, using CSS3's object-fit property. Opera only for now.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ImageView | |
android:layout_width="100dp" | |
android:layout_height="100dp" | |
android:scaleType="centerCrop" | |
android:src="@drawable/foo" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img src="foo.png" | |
style="width:100px; | |
height:100px; | |
-o-object-fit:cover; | |
overflow:hidden;" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment