android-imageView-以编程方式设置非资源图像
我需要发展这个例子:android-imageView-以编程方式设置非资源图像,android,layout,imageview,picasso,Android,Layout,Imageview,Picasso,我需要发展这个例子: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:layout_width="fill_parent" android:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="center"
android:src="@drawable/golden_gate" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dip"
android:layout_gravity="center_horizontal|bottom"
android:padding="12dip"
android:background="#AA000000"
android:textColor="#ffffffff"
android:text="Golden Gate" />
</FrameLayout>
但是由于imageView是从Internet(通过毕加索)读取的,因此我需要通过编程设置图像资源。
android:src=“@drawable/golden_gate”对我来说没用。有什么想法吗?感谢毕加索占位符选项应允许您分配占位符图像,该图像将一直显示,直到从网络下载实际图像为止
是的,我已经看过很多次了
public void setImageResource(int resId)
,但是在这种情况下,它是如何设置的?毕加索函数是:Picasso.load(foto.getURL()).placeholder(R.raw.place\u holder)。error(R.raw.big\u problem)。resize(150150)。centerCrop()。into(imageView)代码>不清楚您想要做什么。您希望以编程方式设置什么?位图?可绘图?我想显示两个重叠的图像。第一张是用毕加索取回的,上面的那张是可画的或是文本