How to add (vertical) divider to a horizontal LinearLayout?

后端 未结 11 641
有刺的猬
有刺的猬 2020-11-27 11:36

I\'m trying to add a divider to a horizontal linear layout but am getting nowhere. The divider just doesn\'t show. I am a total newbie with Android.

This is my layou

11条回答
  •  -上瘾入骨i
    2020-11-27 11:53

    In order to get drawn, divider of LinearLayout must have some height while ColorDrawable (which is essentially #00ff00 as well as any other hardcoded color) doesn't have. Simple (and correct) way to solve this, is to wrap your color into some Drawable with predefined height, such as shape drawable

提交回复
热议问题