Android 毕加索以横向模式显示图像

Android 毕加索以横向模式显示图像,android,imageview,picasso,Android,Imageview,Picasso,使用毕加索库从服务器下载图像并放置在ImageView中,但每次它仅以横向模式显示图像,甚至最初以纵向模式显示图像 我有一些图片在横向模式下,一些在纵向模式下,但下载和显示到ImageView时只在横向模式下 毕加索的用法: Picasso.with(MainActivity.this) .load(imageURL) // web image url .fit().centerInside() .transform(transfo

使用毕加索库从服务器下载图像并放置在ImageView中,但每次它仅以横向模式显示图像,甚至最初以纵向模式显示图像

我有一些图片在横向模式下,一些在纵向模式下,但下载和显示到ImageView时只在横向模式下

毕加索的用法:

        Picasso.with(MainActivity.this)
        .load(imageURL) // web image url
        .fit().centerInside()
        .transform(transformation)
        .error(R.drawable.ic_launcher)
        .placeholder(R.drawable.ic_launcher)
        .into(viewHolder.imageView , new Callback() {
            ....
            }
        });
试试这个

您可以简单地为图像视图提供所需的角度,如下所示

 <ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:rotation="90" />

要使用毕加索旋转图像,只需在毕加索的load()方法中设置旋转角度,如下所示

Picasso.with(MainActivity.this)
        .load(imageURL) // web image url
        .fit().centerInside()
        .transform(transformation)
        .rotate(90)                    //if you want to rotate by 90 degrees
        .error(R.drawable.ic_launcher)
        .placeholder(R.drawable.ic_launcher)
        .into(viewHolder.imageView , new Callback() {
            ....
            }
        });

您可以使用毕加索旋转我们的图像,只需在毕加索加载()方法中添加
。旋转(度)
。如果您从服务器下载,则需要添加额外的字段“方向”,以及其名称和路径,以便在下载时可以检查方向并进行设置accordingly@KaranMer请张贴。旋转(90)作为您的答案,所以我可以接受这会使整个旋转imageview@Sophie我很高兴这有帮助