0
Я не знаю, в чем проблема в моем коде. Я хочу отображать некоторые изображения в GridView, но отображаемые изображения очень малы, и это тоже происходит с изображениями с высоким разрешением. Пожалуйста помоги. Заранее спасибо.Размеры ячейки GridView не меняются
Я не знаю, что делать. Я отправляю свой код тоже.
activity_main.xml файл
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent">
<GridView
android:id="@+id/gridview_stickers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnWidth="90dp"
android:numColumns="auto_fit"
android:horizontalSpacing="10dp"
android:verticalSpacing="10dp"
android:stretchMode="columnWidth"
android:gravity="center">
</GridView>
gridview_items.xml файл
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:orientation="vertical"
android:background="#000000">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/sticker"
android:scaleType="centerCrop"
/>
метод GetView из AdapterClass
public View getView(int position, View convertView, ViewGroup parent) {
View imageView = convertView;
ImageView picture;
if(imageView == null) {
imageView = inflater.inflate(R.layout.gridview_items, parent, false);
imageView.setTag(R.id.sticker, imageView.findViewById(R.id.sticker));
imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
imageView.setPadding(8, 8, 8, 8);
}
picture = (ImageView)imageView.getTag(R.id.sticker);
picture.setImageBitmap(img.get(position).imageBitmap);
return imageView;
}
http://stackoverflow.com/questions/16251569/changing-the-size-of-cells-in-grid-view –
Я посетил эту страницу и попробовал также, не работал .. –