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

后端 未结 11 693
有刺的猬
有刺的猬 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条回答
  •  我在风中等你
    2020-11-27 11:56

    Try this, create a divider in the res/drawable folder:

    vertical_divider_1.xml

    
        
        
            
     
    

    And use the divider attribute in LinearLayout like this:

    
    
        

    Note: android:divider is only available in Android 3.0 (API level 11) or higher.

提交回复
热议问题