我使用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