0
votes

All, The problem I am having is that I created a ListView and set its background and that of the xml resource to transparent #00000000. Then what I did was set the background of the linearlayout that contains my listview and other containers to a drawable (See Pic Below.) Everything comes out as expected when I open the activity, but when I scroll the background changes to black.

Before I click to scroll

However, when I attempt scroll through the list, the background changes to all black (See Pic.)

When Scrolling

any help would be appreciated.

Thx

Code for Java:

 selection2 = (TextView) findViewById(R.id.selection2);
    ListView list = (ListView) findViewById(R.id.listView);
    ArrayAdapter<String> list_adapter = new ArrayAdapter<String>(this, R.layout.main_item, items);
    list.setAdapter(list_adapter);


    list.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                long arg3) {
            selection2.setText(items[arg2]);

        }
    });
1
can you share your list adapter codeRohit Sharma

1 Answers

1
votes

Post codes of setting background to image.

Use this:

listview.setCacheColorHint(0);

or through XML :

 android:cacheColorHint="#00000000"