why is my layout_weight not working?

前端 未结 3 1239
无人共我
无人共我 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条回答
  •  深忆病人
    2021-01-28 13:02

    Change your EditText and Call button with layout_width to "0dp" -

    android:layout_width="0dp"

            android:layout_height="match_parent"
            android:id="@+id/editText"
            android:inputType="phone"
            android:gravity="center"
            android:background="#d9d9d9"
            android:layout_weight="1"
    
            />
    
    
            

    android:layout_width="0dp"

                android:layout_height="match_parent"
                android:id="@+id/callButton"
                android:src="@drawable/call"
                android:clickable="true"
                android:onClick="softkeyboardButton"
                android:background="#ffa62b"
                android:layout_weight="1"
    
                />
    

提交回复
热议问题