@ Override protected boolean setFrame ( int l , int t , int r , int b ) { if ( getDrawable ( ) == null ) { return super . setFrame ( l , t , r , b ) ; } Matrix matrix = getImageMatrix ( ) ; float scaleFactor = getWidth ( ) / ( float ) getDrawable ( ) . getIntrinsicWidth ( ) ; matrix . setScale ( scaleFactor , scaleFactor , 0 , 0 ) ; setImageMatrix ( matrix ) ; return super . setFrame ( l , t , r , b ) ; }
Top crop scale type