效果图:
话不多说,直接上源代码,有兴趣的往下翻阅
activity_main_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=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="380dp">
<EditText
android:id="@+id/edt_number"
android:background="#66ccff"
android:layout_width="80dp"
android:layout_height="50dp"
android:layout_marginTop="300dp"/>
<TextView
android:textSize="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_marginTop="300dp"
android:text=" * "/>
<EditText
android:id="@+id/edt_num"
android:background="#66ccff"
android:layout_width=