看看你imageview的属性和设置图片的代码

解决方案 »

  1.   

    谢谢sa兄,
    <?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:gravity="center"
        android:orientation="vertical" >    <ImageView
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#00ffffff"   ----这个行加跟不加没变化
            android:src="@drawable/rpt" />    <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="TextView" /></LinearLayout>public View getView(int position, View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub
    int pic;
    View view;
    if(convertView==null){
    LayoutInflater layoutInflater = LayoutInflater.from(m_context);
    view = layoutInflater.inflate(R.layout.tab_item_view, null);
    //view.setAlpha(0);
    //view.setBackgroundColor(Color.TRANSPARENT);
    } else
    view = convertView;
    //parent.setBackgroundColor(Color.TRANSPARENT);
    ImageView imageView = (ImageView)view.findViewById(R.id.imageView1); 
            if (imageView != null)
            {
             try {
             pic=Integer.parseInt(m_pc.get(position));
    } catch (Exception e) {
    pic=0;
    }  
             imageView.setImageResource(m_piclist[pic%m_piclist.length]); 
            }        
            TextView textView = (TextView) view.findViewById(R.id.textView1);        
            textView.setText(m_name.get(position));
            textView.setTextColor(Color.BLACK); 
            return view; 
    }