本来是想用相对布局来写计算器的布局,然后莫名其妙的变成了线性布局,心塞。
- 上代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_height="10dp"
android:layout_width="match_parent"
android:layout_weight="0.4">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Calculate布局实现"
android:textColor="#1FC8F8"
android:id="@+id/mainTextView1"
android:textSize="17sp"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:hint="请输入计算"
android:textSize="40sp"
android:text="计算输出口"/>
</RelativeLayout>
<TextView
android:layout_height="1dp"
android:layout_width="match_parent"
android:background="#000000"/>
<LinearLayout
android:layout_height="40dp"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_weight="2">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_weight="1.0"
android:gravity="center"
andro