<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:layout_weight="1"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:background="#79c7ff" android:textColor="#000000" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" android:id="@+id/textVieweng" android:layout_weight="1" android:textSize="55dp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:background="#b2ff30" android:textColor="#000000" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" android:id="@+id/textViewarab" android:layout_weight="1" android:textSize="70dp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:textSize="45dp" android:color="#ff000000" android:layout_width="wrap_content" android:layout_height="70dp" android:layout_weight="1" android:text="1" android:id="@+id/button1" android:onClick="ClickButton1" /> <Button android:textSize="45dp" android:color="#ff000000" android:layout_width="wrap_content" android:layout_height="70dp" android:layout_weight="1" android:text="2" android:id="@+id/button2" android:onClick="ClickButton2" /> <Button android:textSize="45dp" android:color="#ff000000" android:layout_width="wrap_content" android:layout_height="70dp" android:layout_weight="1" android:text="3" android:id="@+id/button3" android:onClick="ClickButton3" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:textSize="45dp" android:color="#ff000000" android:layout_width="wrap_content" android:layout_height="70dp" android:layout_weight="1" android:text="4" android:id="@+id/button4" android:onClick="ClickButton4" /> <Button android:textSize="45dp" android:color="#ff000000" android:layout_width="wrap_content" android:layout_height="70dp" android:layout_weight="1" android:text="5" android:id="@+id/button5" android:onClick="ClickButton5" /> <Button android:textSize="45dp" android:color="#ff000000" android:layout_width="wrap_content" android:layout_height="70dp" android:layout_weight="1" android:text="6" android:id="@+id/button6" android:onClick="ClickButton6" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:textSize="45dp" android:color="#ff000000" android:layout_width="wrap_content" android:layout_height="70dp" android:layout_weight="1" android:text="7" android:id="@+id/button7" android:onClick="ClickButton7" /> <Button android:textSize="45dp" android:color="#ff000000" android:layout_width="wrap_content" android:layout_height="70dp" android:layout_weight="1" android:text="8" android:id="@+id/button8" android:onClick="ClickButton8" /> <Button android:textSize="45dp" android:color="#ff000000" android:layout_width="wrap_content" android:layout_height="70dp" android:layout_weight="1" android:text="9" android:id="@+id/button9" android:onClick="ClickButton9" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:textSize="45dp" android:color="#ff000000" android:layout_width="wrap_content" android:layout_height="70dp" android:layout_weight="1" android:text="0" android:id="@+id/button0" android:onClick="ClickButton0" /> <Button android:textSize="45dp" android:color="#ff000000" android:layout_width="wrap_content" android:layout_height="70dp" android:layout_weight="1" android:text="·" android:id="@+id/buttondot" android:onClick="ClickButtondot" /> <Button android:textSize="45dp" android:color="#ff000000" android:layout_width="wrap_content" android:layout_height="70dp" android:layout_weight="1" android:text="C" android:id="@+id/buttonC" android:onClick="ClickButtonC" android:background="#ff706b" /> </LinearLayout> </LinearLayout> 
  • one
    First, assign the weight ( layout_weght ) of the root layout to the sum of the weights of the nested elements, and better remove this parameter from the root layout at all - pavlofff
  • screenshot in the studio! - Vladyslav Matviienko

0