【发布时间】:2016-01-01 05:09:30
【问题描述】:
我正在尝试在底部创建带有图像和文本的自定义 Gridview,但是当我向下滚动时,由于文本导致对齐不匹配 向下滚动后对齐
向下滚动前对齐
gridview.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<com.staritsolutions.apptitude.CategoryImageResize_Adapter
android:id="@+id/picture"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1.0"
android:scaleType="centerCrop" />
<TextView
android:id="@+id/text"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:gravity="center"
android:layout_weight="150"
android:textColor="@android:color/black" />
</LinearLayout>
</FrameLayout>
【问题讨论】:
-
固定图片大小或在LinearLayout中使用weightsum
标签: android android-layout android-fragments android-activity gridview