如何在窗口小部件中正确缩放ImageView?

时间:2014-02-27 20:42:47

标签: java android xml bitmap widget

我在小部件布局中将两个图像叠加在另一个上面。顶部图像应该在背景图像上方旋转。两者都是ImageViews。如您所见,内圈太小(请查看xkcd.com/now以查看布局应该是什么样子)。我尝试调整文件本身的大小,这没有改变任何东西,我尝试使用mat.postScale,这只给了我一个outOfMemory错误。我正在使用matrix.postRotate来旋转内圈。由于我正在使用RemoteViews(它是一个小部件),我的能力非常有限。那么我怎样才能将内圈调整115%呢? (哦,我不能使用固定值,因为如果调整窗口小部件,它必须改变大小)

这是XML布局:

<ImageView
    android:contentDescription = "@string/app_name"
    android:id="@+id/imagef"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_centerInParent="true"/>
<ImageView
    android:contentDescription = "@string/app_name"
    android:id="@+id/nowView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:scaleType="fitCenter"
    android:adjustViewBounds="true"
    android:layout_centerInParent="true"/>

现在的样子截图:

the inside circle is slightly too small

0 个答案:

没有答案
相关问题