Answered step by step
Verified Expert Solution
Question
1 Approved Answer
< TableLayout xmlns: android = http://schemas.android.com/apk/res/android android :layout_width= match_parent android :layout_height= match_parent xmlns: app = http://schemas.android.com/apk/res/edu.monash.fit2081.calculatorapp android :stretchColumns= * android :layout_marginLeft= 15dp android :layout_marginRight= 15dp
xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res/edu.monash.fit2081.calculatorapp" android:stretchColumns="*" android:layout_marginLeft="15dp" android:layout_marginRight="15dp"> <TableRow android:minHeight="60dp"> <TextView android:id="@+id/resultScreen" android:layout_height="match_parent" android:layout_weight="1" android:textSize="30sp" android:textColor="@android:color/black"/> TableRow> <TableRow android:minHeight="60dp"> <TextView android:id="@+id/InterScreen" android:layout_height="match_parent" android:layout_weight="1" android:gravity="bottom" android:lines="2" android:maxLines="2" android:textSize="25sp" android:textColor="@color/colorPrimaryDark"/> TableRow> <TableRow android:minHeight="60dp"> <Button android:id="@+id/buttonSeven" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttonSevenClick" android:text="7" android:textSize="20sp" /> <Button android:id="@+id/buttonEight" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttonEightClick" android:text="8" android:textSize="20sp" /> <Button android:id="@+id/buttonNine" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttonNineClick" android:text="9" android:textSize="20sp" /> <Button android:id="@+id/buttonSlash" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttonDivisionClick" android:text="/" android:textSize="20sp" /> TableRow> <TableRow android:minHeight="60dp"> <Button android:id="@+id/buttonFour" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttonFourClick" android:text="4" app:layout_constraintRight_toRightOff="@+id/buttonFive" android:textSize="20sp" /> <Button android:id="@+id/buttonFive" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttonFiveClick" android:text="5" android:textSize="20sp" /> <Button android:id="@+id/buttonSix" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttonSixClick" android:text="6" android:textSize="20sp" /> <Button android:id="@+id/buttonAsterisk" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttonAsteriskClick" android:text="*" android:textSize="20sp" /> TableRow> <TableRow android:minHeight="60dp"> <Button android:id="@+id/buttonOne" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttonOneClick" android:text="1" android:textSize="20sp" /> <Button android:id="@+id/buttonTwo" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttonTwoClick" android:text="2" android:textSize="20sp" /> <Button android:id="@+id/buttonThree" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttonThreeClick" android:text="3" android:textSize="20sp" /> <Button android:id="@+id/buttonMinus" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttonMinusClick" android:text="-" android:textSize="20sp" /> TableRow> <TableRow android:minHeight="60dp"> <Button android:id="@+id/buttonDecimal" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttoDecimalClick" android:text="." android:textSize="20sp" /> <Button android:id="@+id/buttonZero" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttonZeroClick" android:text="0" android:textSize="20sp" /> <Button android:id="@+id/buttonEquals" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttonEqualsClick" android:text="=" android:textSize="20sp" /> <Button android:id="@+id/buttonAdd" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttonAddClick" android:text="+" android:textSize="20sp" /> TableRow> <TableRow android:minHeight="60dp"> <Button android:id="@+id/buttonClear" android:layout_width="wrap_content" android:layout_height="match_parent" android:onClick="buttonClearClick" android:text="C" android:textSize="20sp" /> TableRow> TableLayout>
How to convert this table layout to constraint layout?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started