Set Textview + Edittext + Button

后端 未结 4 1698
独厮守ぢ
独厮守ぢ 2021-01-23 07:50

I want to put in the same row a TextView, and Edittext and a button but I am having the problem that the button is not aligned properly to left and in small screens edittext fil

4条回答
  •  时光说笑
    2021-01-23 08:23

    First, many people will tell you that hint is Android's solution for not needing the label. I don't care if you use the label or not but it does save you space, especially on smaller screens. That was just an FYI.

    Now, your RelativeLayout that only has a Button appears to be useless...I would remove that. You can use layout_weight so that each View takes up the appropriate amount of space. Make sure to make the layout_width="0dp". So it may look something like

    
    
        
    
        
    
        

    Here I used 2,3,1 for the weights of your TextView, EditText, and Button respectively. You may need to change those to get exactly what you want but that should give you a start.

提交回复
热议问题