我使用Picasso加载背景图像,并使用相对布局。背景图片需要时间加载,有些甚至没有加载。我这段代码是,花时间在android中加载背景图像
final int k = random.nextInt(20);
ImageView imageView= (ImageView)findViewById(R.id.backgrd);
TypedArray imgb = getResources().obtainTypedArray(R.array.backg);
int resourceId = imgb.getResourceId(k, 0);
Picasso.with(getApplicationContext()).
load(resourceId).
fit().
noPlaceholder().
into(imageView);
我试图用调整大小()Picasso Taking time to load images还,但它不工作。
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relative1"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/backgrd"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
/>
<ImageView
android:id="@+id/img1"
android:paddingTop="90dp"
android:layout_width="wrap_content"
android:layout_height="400dp"
/>
什么是你的简洁问题? – RabidMutant
检查带宽或者图像是否存储在本地,然后使用UniversalImageLoader –
@RabidMutant我没有得到您的问题。 – Sanik