2

根据毕加索的javadocresizeDimen() ,构造函数是:

public RequestCreator resizeDimen(int targetWidthResId,
                              int targetHeightResId)

所以在我的代码中使用系统属性:

Picasso.with(context).load(URL)
    .resizeDimen(android.R.attr.listPreferredItemHeightLarge, 
                 android.R.attr.listPreferredItemHeightLarge)
    .centerCrop()
    .into(holder.Logo);

但我得到:

E/AndroidRuntime(7588): android.content.res.Resources$NotFoundException: Resource ID #0x1010386

我不明白,因为典型System.out.println(android.R.attr.listPreferredItemHeightLarge);会在实践中返回对象的 id:

I/System.out(7588): 16843654

为什么我会在这里收到错误?

4

1 回答 1

3

它必须是Dimension资源 id(<dimen>资源),而不是Dimension属性 id。

于 2014-02-16T14:49:05.143 回答