Glide无法在Android上正确调整图像大小

时间:2016-08-24 18:18:59

标签: android android-imageview android-glide

我使用bumptech 库在我的应用程序上显示两个不同活动的底部横幅图像。问题是主要活动加载图像并以完整尺寸显示而不是显示居中

enter image description here

我覆盖了两个定义中的大小,但我无法在第一个Activity上调整图像大小。我认为第二个是使用滑行加载的缓存图像,但我不太确定。

enter image description here

  

在两个布局活动上声明的图像代码

private static Excel.Workbook MyBook = null;
private static Excel.Application MyApp = null;
private static Excel.Worksheet MySheet = null;
static void ReadExcel()
{
    MyApp = new Excel.Application();
    MyApp.Visible = false;
    MyBook = MyApp.Workbooks.Open("C:\\test.xlsx");
    MySheet = (Excel.Worksheet)MyBook.Sheets[1];

    if (MySheet.Visible == Excel.XlSheetVisibility.xlSheetHidden)
    {
        //handle hidden sheet here
    }
}
  

两项活动的滑行库代码

<ImageView
    android:id="@+id/main_sponsor_banner"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:scaleType="centerInside"
    android:src="@drawable/default_main_sponsor"/>

谢谢,感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

尝试使用DiskCacheStrategy.SOURCE