Two views in each list item

前端 未结 2 1781
有刺的猬
有刺的猬 2021-01-15 14:35

I\'m trying to show two different views in each element of the list. Both vews are text views, but I want one of them to be enclosed in a square with a different color. I kn

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-15 15:05

    More details would help; my solution may not be accurate, as I don't know what you want very well.

    Check out the View element's background color: http://developer.android.com/reference/android/view/View.html#setBackgroundColor(int).

    If you have two views, and set the background colors to different values, you can get each view to have square around it. This may be able to create the desired effect.

提交回复
热议问题