我需要在纵向 Activity 中显示旋转 90 度的 ImageView,
由于我使用 picasso 库进行缓存,因此我无法自由访问位图对象,
并使用 Support lib 进行旋转我没有得到我应该得到的结果,
代码“只是”如下:
<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"/>
有什么办法可以达到同样的结果吗??
在 android 4.0 或更高版本中旋转工作。
最佳答案
你可以使用 picasso ReqgueshstCreator.rotate(float degree)
见文件
http://square.github.io/picasso/javadoc/com/squareup/picasso/RequestCreator.html
前任)
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) ;
关于android - 带有 picasso 和支持库的 android 2.2 中的 ImageView 旋转,但不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/20054600/