【发布时间】:2015-06-05 10:27:39
【问题描述】:
我正在考虑使用 Picasso 库从 URL 下载图像并将其传递到圆形图像视图中,但由于 picasso 要求您传入实际的 imageView,因此我对如何执行此操作停滞不前
我正在使用这里的毕加索图书馆http://square.github.io/picasso/ 和来自这里的圆形图像视图类https://github.com/hdodenhof/CircleImageView
这是我获取图像的代码的开始
private void getData() {
userName.setText(prefs.getString("userName",""));
jobTitle.setText(prefs.getString("profile",""));
userLocation.setText(prefs.getString("location",""));
// ??????
// Picasso.with(context).load(image link here).into(imageview here);
//CircleImageView img = new CircleImageView(this);
//img.setImageResource();
//img.setImageBitmap();
//img.setImageDrawable();
//img.setImageURI();
}
编辑:
这是 circleImageView 的 xml
<michael.CircleImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/shadow"
android:layout_gravity="center"
android:layout_marginTop="16dp"
app:border_width="2dp"
app:border_color="#274978"
android:id="@+id/circleImageView"
【问题讨论】: