今天刚学完AS新的一节课,发一下代码和截图记录一下。
运行截图:
xml代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".LinerActivity2">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="0"
android:gravity="end"
android:id="@+id/tv1"
android:textSize="40sp"
android:layout_weight="1"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1">
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="c"
android:textColor="#ff0000"
android:layout_weight="1"
android:id="@+id/btn_c"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"