我正在使用默認幻燈片構建器的AppIntro https://github.com/apl-devs/AppIntro 庫。如何在AppIntro庫中顯示gif?
它工作的很好,但我無法將gif作爲默認構建器的drawable來傳遞。
addSlide(AppIntroFragment.newInstance(title, description, image, backgroundColor));
我看到android有默認顯示gif的問題,我必須使用GifImageLoader或Glide加載gif。
Glide
.with(context)
.load("imageUrl")
.asGif()
.placeholder(R.drawable.gifImage)
.crossFade()
.into(imageView)
我可以嘗試,但我沒有一個ImageView的,我可以進入的說法,如果我使用默認的建設者。
我也試過GifDrawable gifFromResource = new GifDrawable(getResources(), R.drawable.anim);
從Display Animated GIF,但它給出了一個錯誤。
我下一個最接近的選擇是創建一個自定義片段來與AppIntro一起使用,我真的不想這樣做。
有沒有辦法將gif傳遞到默認的幻燈片生成器並讓它播放?
可以使您介紹滑塊,並修改它根據您的要求 請點擊此鏈接https://www.androidhive.info/2016/05/android-build-intro-slider-app/ –