【问题标题】:Universal Image Loader Fade In From Black?通用图像加载器从黑色淡入?
【发布时间】:2014-03-23 08:46:51
【问题描述】:

我正在使用 Universal Image Loader 从网络上“延迟加载”我的图像。是否可以使用动画中的淡入淡出但“从黑色”而不是“从白色”淡入?我的应用程序有黑色背景,我希望它能够平滑地淡化它,而不是“闪烁”,因为当前效果看起来像。

这是从白色逐渐消失的代码

  DisplayImageOptions options;
            options = new DisplayImageOptions.Builder()
            .showImageOnLoading(R.drawable.no_poster)
            .showImageForEmptyUri(R.drawable.no_poster)
            .showImageOnFail(R.drawable.no_poster)
            .displayer(new FadeInBitmapDisplayer(500))
            .cacheInMemory(true)
            .cacheOnDisc(true)
            .build();
            ImageView myPosterView = (ImageView)findViewById(R.id.movieposterlarge);
            imageLoader.displayImage(movie_poster, myPosterView,options);

【问题讨论】:

    标签: android fadein universal-image-loader


    【解决方案1】:

    这似乎对我有用。

        options = new DisplayImageOptions.Builder()
                .showImageOnLoading(android.R.color.black)
                .showImageForEmptyUri(android.R.color.black)
    

    注意,您还必须将正在使用的任何视图的背景设置为黑色:

    <GridView
        android:id="@+id/gridview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="0dp"
        android:background="@color/Black"
        android:horizontalSpacing="0dp"
        android:numColumns="1"
        android:padding="0dp"
        android:stretchMode="columnWidth"
        android:verticalSpacing="10dp" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-20
      • 2013-03-31
      • 2014-06-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-09
      相关资源
      最近更新 更多