2012-04-03 48 views
0
"<Keyboard>" does not set the required layout_height attribute: 
(1) Set to "wrap_content" 
(2) Set to "fill_parent" 
"<Row>" does not set the required layout_width attribute: 
(1) Set to "wrap_content" 
(2) Set to "fill_parent" 
"<Row>" does not set the required layout_height attribute: 
(1) Set to "wrap_content" 
(2) Set to "fill_parent" 
"<Key>" does not set the required layout_width attribute: 
(1) Set to "wrap_content" 
(2) Set to "fill_parent" 
"<Key>" does not set the required layout_height attribute: 
(1) Set to "wrap_content" 
(2) Set to "fill_parent" 
com.android.layoutlib.bridge.MockView cannot be cast to android.view.ViewGroup 
You must supply a layout_height attribute. 
Exception details are logged in Window > Show View > Error Log 
The following classes could not be found: 
- Keyboard (Fix Build Path, Edit XML) 
- Row (Fix Build Path, Edit XML) 
- com.example.android.softkeyboard.LatinKeyboardView (Fix Build Path, Edit XML, Create Class) 
+0

它切斷在開始 – evc 2012-04-03 20:54:49

回答

3

這意味着你的XML鍵盤佈局文件丟失了一些組件android:layout_width和/或android:layout_height

編輯

在第二一目瞭然,它看起來像你把你的鍵盤佈局文件中的res/layout文件夾中。它屬於res/xml文件夾。

+0

它無法正常工作我的代碼一定是錯誤的....我不知道該怎麼辦.. – evc 2012-04-03 21:14:16

+0

@evc - 請參閱我更新的答案 – 2012-04-03 21:45:43

0

項目中的一個XML文件具有

「不設置所需layout_height屬性」的元素。

的每個元素,將其設置,例如:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="horizontal" 
    android:layout_width="fill_parent" 
    **android:layout_height="fill_parent"** 
    android:background="@android:color/transparent"> 
+0

我做到了,但沒有運氣我不知道爲什麼這個softkeyboard不會顯示在圖形視圖,它不斷給我錯誤..我使用SDK鍵盤示例... :( – evc 2012-04-03 21:13:20

+0

哦,再看一遍後,我得到它讓我們看看會發生什麼 – evc 2012-04-04 21:23:29