网格视图图像错误

时间:2014-03-08 12:11:17

标签: android gridview

你好我是android的新手。请帮忙。

我的SingleViewActivity java

package com.example.helloworld;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;

public class SingleViewActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
  super.onCreate(savedInstanceState);  
  setContentView(R.layout.single_view);

  // Get intent 
  Intent i = getIntent();

  // Selected image id
  int position = i.getExtras().getInt("id");
  ImageAdapter imageAdapter = new ImageAdapter(this);

  ImageView imageView =(ImageView) findViewById(R.id.SingleView);   
  imageView.setImageResource(imageAdapter.mThumbIds[position]);}}

此singleview xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<ImageViewandroid:id="@+id/SingleView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"/>
</LinearLayout>

所以我的问题是,当点击的拇指图像没有显示完整图像时

抱歉我的英文不好

1 个答案:

答案 0 :(得分:0)

将比例尺类型添加到ImageView,

android:scaleType="fitXY"