0
我想使用eclipse ADT來運行一個非常簡單的Android演示。該應用編譯&模擬器打開但沒有控件顯示。我有一個應用程序的標題,但不顯示按鈕&文本字段。有任何想法嗎?我在控制檯中看不到任何錯誤。模擬器中沒有控件?
<?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" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_send"
android:onClick="sendMessage"/>
</LinearLayout>
分享一些代碼。 –
是否從顯示的活動中調用了setContentView()? –
就是這樣......謝謝。但爲什麼官方的Android教程沒有提到這一點? 。我知道我只是在開始的一堂課,但我認爲谷歌會給你工作代碼樣本。 –