返回列表 发帖

[UI界面] 这个问题怎么解决啊

画面上有个ListView,背景色是绿色。但我拖拽鼠标后,有内容的部分背景就变成黑的了(如图)。
如果我的字体是黑色的话,就什么也看不见了。。。
这个问题能解决吗?
我试过在onTouchEvent里监听MotionEvent.ACTION_UP,好像还是不太好使。。。
各位大侠帮帮忙~~~
附件: 您需要登录才可以下载或查看附件。没有帐号?免费加入

代码不贴出来怎么解决啊!!!!!!

TOP

下面就是代码~~
Activity(Test.java)
  1. import android.app.Activity;
  2. import android.os.Bundle;
  3. import android.widget.ArrayAdapter;
  4. import android.widget.ListView;

  5. public class Test extends Activity {
  6.     /** Called when the activity is first created. */
  7.     @Override
  8.     public void onCreate(Bundle savedInstanceState) {
  9.         super.onCreate(savedInstanceState);
  10.         setContentView(R.layout.main);
  11.         
  12.         ListView listView = (ListView)findViewById(R.id.list);
  13.         listView.setAdapter(new ArrayAdapter<String>(this,
  14.                 android.R.layout.simple_list_item_1, mStrings));
  15.     }
  16.    
  17.     String[] mStrings = {"aaaa", "bbbb", "cccc", "dddd", "eeee", "fff"};
  18. }
复制代码
main.xml:
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.         android:orientation="vertical" android:layout_width="fill_parent"
  4.         android:layout_height="fill_parent" android:background="#9AE4DD">

  5. <ListView android:id="@+id/list"
  6. android:layout_height="fill_parent"
  7. android:layout_width="fill_parent"></ListView>
  8. </LinearLayout>
复制代码

TOP

在listview的xml文件中加入:android:cacheColorHint="#00000000"就可以解决。
wo

TOP

哈哈 问题解决 谢谢!~

TOP

在listview的xml文件中加入:android:cacheColorHint="#00000000"就可以解决。
tongtong 发表于 2010-2-9 13:58



    正解!

TOP

正解

TOP

返回列表