【发布时间】:2015-11-01 14:19:04
【问题描述】:
我制作了一个应用程序,可以在网格视图中显示本地存储的图像。我曾经使用毕加索,但由于许多问题我停止使用它(它没有在某些设备上加载图像)。然后我切换到滑翔,一切很好,只是图像被垂直拉伸。这会导致滚动问题。我在使用毕加索时从未遇到过这样的问题。我该如何解决这个问题?
我的 MainActivity 代码-
Glide.with(MainActivity.this)
.load(mThumbIds[position])
.placeholder(R.raw.place_holder)
.error(R.raw.big_problem)
.centerCrop()
.into(imageView);
return imageView;
我的activity_main.xml文件代码
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:background="@color/colorPrimary"
android:layout_height="match_parent">
<GridView
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:columnWidth="150dp"
android:numColumns="2"
android:layout_above="@+id/adView" />
<com.google.android.gms.ads.AdView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/adView"
ads:adSize="SMART_BANNER"
ads:adUnitId="@string/banner_ad_unit_id"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
</com.google.android.gms.ads.AdView>
</RelativeLayout>
【问题讨论】:
标签: android android-activity android-gridview android-glide