开发者

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 ma开发者_运维知识库king 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜