【发布时间】:2012-12-05 19:36:13
【问题描述】:
即使我将 (android:layout_width="fill_parent") 给我的 Imageview 类,图像也没有全宽显示
<ImageView android:id="@+id/img"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/button_layout"
android:layout_below="@+id/middle1"
/>
这里我得到了我的位图
if (orientation != 0) {
Matrix matrix = new Matrix();
matrix.postRotate(orientation);
bMapRotate = Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(),
bmp.getHeight(), matrix, true);
} else
bMapRotate = Bitmap.createScaledBitmap(bmp, bmp.getWidth(),
bmp.getHeight(), true);
findViewById(R.id.img).setVisibility(View.VISIBLE);
//Here I set the bitmap ((ImageView)findViewById(R.id.img)).setImageBitmap(bMapRotate);
findViewById(R.id.preview).setVisibility(View.GONE);
我无法理解为什么它没有占据整个屏幕长度,即使我在我的 xml 中将 fill_parent 赋予 imageview
【问题讨论】:
-
尝试使用比例属性
-
你在做setImageBitmap吗??和你使用矩阵的位图??
-
你在做什么?你想在改变方向时缩放与设备屏幕尺寸相同的图像吗?
-
你的 ImageView 的父布局是什么?你能从你的 xml 布局中发布更多的片段吗?
标签: android android-layout android-imageview