滑动图像加载错误

时间:2018-01-02 15:44:43

标签: android

我使用 Glide drawable 加载我的图片。但有些图像,但有时Glide不会加载图像。 我的代码:

的.java:

public ImageButton home_ib19;
public ImageButton home_ib20;

home_ib19 = (ImageButton)findViewById(R.id.home_ib19);
    Glide.with(Home.this)
            .load(R.drawable.moviep_split)
            .centerCrop()
            .fitCenter()
            .into(home_ib19);

    home_ib20 = (ImageButton)findViewById(R.id.home_ib20);
    Glide.with(Home.this)
            .load(R.drawable.moviep_the_red_turtle)
            .centerCrop()
            .fitCenter()
            .into(home_ib20);

(从1到18它工作正常,我使用相同的方法,但使用这2,图像不会加载)

.XML:

<ImageButton
            android:id="@+id/home_ib19"
            android:layout_width="98dp"
            android:layout_height="155dp"
            android:layout_alignStart="@+id/home_ib16"
            android:layout_below="@+id/home_ib16"
            android:layout_marginTop="14dp"
            android:background="@android:color/transparent"
            android:scaleType="fitCenter" />

        <ImageButton
            android:id="@+id/home_ib20"
            android:layout_width="98dp"
            android:layout_height="155dp"
            android:layout_alignParentBottom="true"
            android:layout_alignStart="@+id/home_ib18"
            android:background="@android:color/transparent"
            android:scaleType="fitCenter" />

    </RelativeLayout>
</ScrollView>

你可以在 ScrollView 中的RelativeLayout中看到我的所有 ImageButton

0 个答案:

没有答案