why is my layout_weight not working?

前端 未结 3 1240
无人共我
无人共我 2021-01-28 12:48

I have this xml file.I can\'t understand why my second linearlayout which contains editText and callButton isn\'t looking right. It looks like this (the line with the part pictu

3条回答
  •  闹比i
    闹比i (楼主)
    2021-01-28 12:54

    Try setting the layout_width of the EditText and the ImageButton to 0dp. I also recommend you to put the attribute android:scaleType="fitCenter" in the ImageButton so that the image fits inside the button and it doesn't look bigger like in the screenshot you provided.

    Here is the XML file:

    
    
        
        
    
        
            
            
    
            
    
    
            
        
    
        
    
            
    
    
            
    
            
    
            
    
        
    
    
    

    And this is how it looks:

    I hope it helps!

提交回复
热议问题