我正在嘗試在Android應用中顯示文本,但我對Android開發完全陌生。我很瞭解Java,但是,如何在應用程序的中間顯示文本,就像它是一個短信應用程序一樣?我有一個發送按鈕,但他們點擊後發送底部的文本字段,我希望能夠顯示他們在中間鍵入的內容。顯示打字文本
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<EditText android:id="@+id/edit_message"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/edit_message"
android:layout_gravity="bottom" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="sendMessage"
android:text="@string/button_send"
android:layout_gravity="bottom"/>
</LinearLayout>
只需添加一個新的TextView,並在每次單擊該按鈕時添加該TextView。 – ElefantPhace 2013-03-06 01:51:50
我該怎麼做?對不起,我對Android開發很陌生(我剛剛開始20分鐘前..).. – 2013-03-06 01:53:39