Android: Relative layout content goes below screen

后端 未结 2 574
遥遥无期
遥遥无期 2021-01-16 06:57

I\'m new to android and I\'m just trying to create a chat client. However the content at the bottom just goes off-screen.

The layout files:

chat_layout.xml

2条回答
  •  囚心锁ツ
    2021-01-16 07:26

    You've got some logical mistake in implementing a RelativeLayout. First, you don't have to set the orientation in case of RelativeLayout. Second, you don't have to capsulate the whole form inside a LinearLayout as you're using RelativeLayout you can arrange the views relatively with other views. So here you layout should look like.

    
    
        
    
    

    Here's your activity_main.xml modified. This is from a working version from my code. Please modify as your need. You may have to change the ids.

    
    
        
    
            
    
            
    
                
    
            
        
    
    
    

提交回复
热议问题