【发布时间】:2011-07-25 23:38:21
【问题描述】:
我有一个 imageView,它会将图像逆时针旋转 90 度,并且图像不会填满屏幕。
我有一个 imageviewer.xml,它被定义为:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/LinearLayout01"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
我从我的数据库中获取图像的路径 (imagePath) 并使用此代码将其插入到视图中:
Uri uri = Uri.parse(imagePath);
img.setImageURI(uri);
但是,当图像出现在活动中时,它会逆时针旋转 90 度,并且不会像预期的那样填满整个屏幕 - 尽管我在运行前在同一台设备上以纵向模式拍摄了照片我的应用程序。
任何人都知道什么是错的或什么可能是错的?
【问题讨论】:
-
从上到下还是从左到右翻转?你的意思是旋转?逆时针?
-
我的意思是旋转 - 逆时针:/
-
如果你把照片保存到你的电脑上,它也会以同样的方式旋转吗?
-
是的。你知道我怎么转吗?