LinearLayout: layout_gravity=“bottom” not working on Horizontal LinearLayout

前端 未结 7 955
青春惊慌失措
青春惊慌失措 2020-12-02 09:07

Ok, First of all, I searched all the internet, but nobody has a similar problem like this. So, all I want is to have 3 textViews, bottom aligned with the screen and with the

7条回答
  •  一个人的身影
    2020-12-02 09:54

    **EDIT:

    If this doesn't do everything, add the baselinealigned flag as mentioned in one of the answers below by Timmmmm. That is a better way.

    Use This

    EDITED LAYOUT: Ok I edited it and also added colors and gravity to let the textviews at the bottom have equal height and width and also aligh the text at the bottom and in the center of each view.

        
    
            
                  
            
        
    

    It should do exactly what you asked.

    It uses a LinearLayout inside a RelativeLayout but sometimes it is required to nest them to get what we want. Add any more views you might want in the relative layout and you will always have your texts at the bottom as long as the last child in your RelativeLayout is this LinearLayout as shown above.

提交回复
热议问题