小學四則運算口算練習app---No.2

來源:互聯網
上載者:User

標籤:ima   空白頁   width   text3   alc   根據   ica   enc   too   

經過昨天的瞭解,雖然還是很懵,總要下手摸到滑鼠來寫第一個頁面! 這是一開始設定出體數目和時間的頁面,使用者根據提示進行相關設定即可!

代碼如下:

 

<?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:background="@mipmap/cat"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".CalculatorsActivity" >

<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">



<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:textSize="25sp"
android:text="輸入題數" />

<EditText
android:id="@+id/editText2"
android:textSize="25sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:ems="4"
android:inputType="number" />
</TableRow>

<TableRow
android:id="@+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25sp"
android:text="輸入時間" />

<EditText
android:id="@+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="1"
android:textSize="23sp"
android:inputType="number" />

<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25sp"
android:text="分" />

<EditText
android:id="@+id/editText4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="3"
android:textSize="23sp"
android:inputType="number" />

<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25sp"
android:text="秒" />
</TableRow>


<TableRow
android:id="@+id/tableRow5"
android:layout_width="wrap_content"
android:layout_height="wrap_content">

</TableRow>

<Button
android:id="@+id/button1"
android:layout_marginTop="50dp"
android:textSize="30sp"
android:layout_width="330dp"
android:layout_height="60dp"
android:text="開始" />

</TableLayout>



</LinearLayout>


在這個頁面上嘗試了一下頁面的跳轉(只是調到一個空白頁面 先把跳轉代碼熟悉起來),但是遲遲不能跳轉,跳轉代碼如下:

經過幾番波折 原因如下:建立的Activity都需要註冊,否則運行會出錯,如所示。開啟AndroidManifest.xml檔案,添加<activity android:name=".MianActivity"></activity>代碼, 進行簡單註冊就可以了。一定要註冊,否則跳轉時會閃退!

今天順利完成了頁面的跳轉!



小學四則運算口算練習app---No.2

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.