Center two buttons horizontally

后端 未结 18 1300
我在风中等你
我在风中等你 2020-12-12 13:32

I try to arrange two buttons (with images on them which work fine) next to each other and to center them horizontally. That\'s what I have so far:



        
18条回答
  •  清歌不尽
    2020-12-12 14:03

    This seems like a very old question, but I had the same problem too. I had to place two buttons next to each other in the middle of the screen (horizontally). I ended up placing the two buttons inside a linear layout and placing the linear layout in a relative layout with its gravity set to center.


    [UPDATE] I found an even simpler solution:

    
    
        

    This is what I had before:

    
    
        
    
            

提交回复
热议问题