發生異常: 字符串索引超出範圍:0 異常詳細信息記錄在窗口>顯示視圖>錯誤日誌 以下類找不到: - 的TextView(更改爲android.widget.TextView,修復構建路徑,編輯XML)入門android系統中的XML文件時出現錯誤渲染過程中
Getting this Error when i open graphic layout of XML file. Help me in resolving this.
發生異常: 字符串索引超出範圍:0 異常詳細信息記錄在窗口>顯示視圖>錯誤日誌 以下類找不到: - 的TextView(更改爲android.widget.TextView,修復構建路徑,編輯XML)入門android系統中的XML文件時出現錯誤渲染過程中
Getting this Error when i open graphic layout of XML file. Help me in resolving this.
您使用Button的背景爲:android:background="@layout/button_style"
什麼是button_style
?如果是風格,則將代碼轉換爲styles.xml
或如果它是selector
,則將其移至drawables
。 TextView中的tableleftborder
也是如此。
其次,在你第一次的TextView添加android:textStyle="normal"
或者乾脆刪除它,使它像下面這樣:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:text="UGD Demand Details"
android:textColor="#FFF"
android:textSize="20sp"/>
希望它能幫助:)
幫助好友.. :)謝謝youuu .. :) – 2015-03-03 04:31:31
很高興幫助:) – 2015-03-03 04:32:01
頁眉RelativeLayout的第一個TextView的具有android:textStyle=""
也RelativeLayout的內部滾動視圖具有android:height="match_parent"
這應該是 「WRAP_CONTENT」
改變它多米尼克。仍然是例外。 – 2015-03-03 04:24:53
android:textStyle =「」我從你的代碼中刪除了這個屬性,並且還刪除了所有的android:background =「@ layout/button_style」和tableleftborder,並且該錯誤消失了 – 2015-03-03 04:40:08
Yup ..工作:) – 2015-03-03 04:50:42
安置自己的XML請。 – 2015-03-03 04:09:55
你正在使用Button的背景:'android:background =「@ layout/button_style」'什麼是button_style?如果是風格,將代碼移至styles.xml,或者如果它是選擇器,則將其移至drawable。 'tableleftborder'也一樣。然後在你的第一個TextView中添加'android:textStyle =「normal」'。 – 2015-03-03 04:24:06
這是一個選擇器。 N移動到drawables。但仍然沒有工作。還有其他建議嗎? – 2015-03-03 04:24:20