我在android中使用TextView和EditText和Button開發了一個基本的UI活動頁面。我已經將TextView textColor設置爲某個十六進制值,並且因此我的應用程序崩潰了,如果刪除了textColor,則表示應用程序完美運行。 目標SDK 2.3 =這裏 是代碼由於main.xml中的TextColor導致Android應用程序崩潰
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:padding="15dp"
android:gravity="center_vertical|center_horizontal">
<TextView android:id="@+id/textView" android:text="Enter search Key"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:textColor="#ff3300"
android:layout_gravity="left" />
<EditText android:id="@+id/searchkey" android:layout_width="match_parent"
android:layout_height="wrap_content" android:hint="Search Key ..." />
<Button android:text="@string/button" android:layout_height="wrap_content"
android:id="@+id/button1" android:layout_width="wrap_content" />
</LinearLayout>
我們可以設置文字顏色爲TextView的或者是有別的東西是錯誤的代碼。
在此先感謝...
crash log please .. – 2011-12-23 09:55:36
其對我來說工作很好.. – 2011-12-23 09:56:21
感謝他們工作 – 2011-12-23 10:09:45