spentak
spentak

Reputation: 4727

TwoLineListItem - Custom attributes

How can I override the XML attributes of TwoLineListItem. I don't want to do it Java. I'm trying to make the backgrounds of the view and the textViews transparent, but it isn't working when I do it in Java.

setBackGroundDrawable setBackGroundColor setBackGroundResource

These don't seem to do what I need them to do. I've tried making no background. I've tried setting an alpha value of 0 to the color, but I still get the same old white list boxes. I have a drawable background that is behind the TwoLineListItem view, and thats all I want to show for the background, not the Item background.

Upvotes: 0

Views: 806

Answers (1)

Khawar
Khawar

Reputation: 5227

According to my understanding of your question you are trying to make your TextView's background to trasparent. this is what i use to do this:

 TextView tv = (TextView)findViewById(R.id.textviewID);
 tv.setBackgroundColor(Color.TRANSPARENT);

And I didn't get your point about TwoLineListItem. But if you want it to become single line, then write in xml properties of your TextView:

android:singleLine="true"

If this was not the question then please elaborate a bit.

Upvotes: 1

Related Questions