新手初学者求关于Adapter的有关问题

新手菜鸟求关于Adapter的问题?xml version1.0 encodingutf-8?LinearLayout xmlns:androidhttp:

新手菜鸟求关于Adapter的问题
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="match_parent"
  android:orientation="vertical" >
   
  <TextView
  android:id="@+id/textView2"
  android:layout_width="fill_parent"
  android:layout_height="40.0dip"
  android:background="@drawable/topbar"
  android:gravity="center"
  android:text="@string/main_ecard"
  android:textAppearance="?android:textAppearanceLarge"
  android:textColor="@color/white" />
   
   
  <LinearLayout
  android:id="@+id/linearLayout2"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:orientation="horizontal" >

  <ImageView
  android:id="@+id/img"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_margin="5dp" />

  <LinearLayout
  android:id="@+id/linearLayout3"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  >
  <TextView
  android:id="@+id/title"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:textColor="#FFFFFFFF"
  android:textSize="22dp" />

  <TextView
  android:id="@+id/info"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:textColor="#FFFFFFFF"
  android:textSize="13dp" />
  </LinearLayout>
 </LinearLayout>
   
</LinearLayout>


这是layout中的代码,,没有使用listView,想做一个list列表

activity的代码
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);

findViews();
showResults();
}

private void findViews(){
 
}

private void showResults(){  
SimpleAdapter adapter = new SimpleAdapter(this,getData(),R.layout.ecard,
  new String[]{"title","info","img"},
  new int[]{R.id.title,R.id.info,R.id.img});
  setListAdapter(adapter);  
}

private List<Map<String, Object>> getData() {
  List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
 
  Map<String, Object> map = new HashMap<String, Object>();
  map.put("title", "G1");
  map.put("info", "google 1");
  map.put("img", R.drawable.g1);
  list.add(map);
 
  map = new HashMap<String, Object>();
  map.put("title", "G2");


  map.put("info", "google 2");
  map.put("img", R.drawable.g2);
  list.add(map);
 
  map = new HashMap<String, Object>();
  map.put("title", "G3");
  map.put("info", "google 3");
  map.put("img", R.drawable.g3);
  list.add(map);  
   
  return list;
  }

显示时,一直出现textView2的内容和下面的挨着重复出现,也就是linearLayout2 下面有几个,textView2的内容也有几个。。哪位告诉下是布局问题还是啥问题。。


[解决办法]
你这问题描述没看懂,重复出现是什么意思?用的是ListActivity?
你说的是多个Item吧,三条数据三个Item吧?
[解决办法]
没有看懂问题..
[解决办法]
textView2不应该写在item上,应该写在listview那个布局上
[解决办法]

探讨

引用:

textView2不应该写在item上,应该写在listview那个布局上


楼上的哥们,你的意思是 将
------topbar标题图片(textView2中的背景图片和居中文字)-----
item1
item2
item3
这整个内容写到ListView里面
是不是ListView里面比如有一个head属性设置头……