Question

I need to display an ImageView rotated by 90 degrees in a portrait activity, since I'm using the picasso library for caching i cannot access freely the bitmap object, and using the Support lib for rotation I don't get the result that I should,

the code is "just" as follows:

<ImageView
   android:id="@+id/imageId"
   android:layout_height="match_parent"
   android:layout_width="wrap_content"
   android:layout_weight="1"
   android:rotation="90"
   android:gravity="center"/>

is there any way I can reach the same result??

In android 4.0 or higher rotation works.

Was it helpful?

Solution

you can use Picasso ReqgueshstCreator.rotate(float degrees)

See Document http://square.github.io/picasso/javadoc/com/squareup/picasso/RequestCreator.html

ex)

Picasso.Builder builder = new Picasso.Builder(context);
Picasso picasso = builder.build() ;
ImageView imageId = (ImageView) findViewById(R.id.imageId) ;
picasso.load("URL").rotate(degrees).into(imageId) ;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top