[否XML内容。请添加到您的文档&QUOT根视图或布局;您的、视图、布局、文档

2023-09-06 16:44:37 作者:闭加锁、先生

我试图code一softkeyboard 2.1,而如果我code(见code以下),在main.xml中图形视图是不显示任何内容,并说没有XML的内容。请添加根视图或布局到您的文档我试图把在TextView中的code,但仍然没有运气,我不能让softkeyboard在所有显示,其好像我的code被忽略。 。我已经试过这两个codeS分开没有什么作品

 < com.example.android.softkeyboard.LatinKeyboardView的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android    机器人:ID =@ + ID /键盘    机器人:layout_alignParentBottom =真    机器人:layout_width =match_parent    机器人:layout_height =WRAP_CONTENT/><键盘    机器人:keyWidth =10便士%    机器人:keyHeight =50像素    机器人:horizo​​ntalGap的=2px的    安卓的verticalGap =2px的>   <行机器人:keyWidth =32PX>   <关键的android:keyLabel =A/>...< /行>...< /键盘> 

解决方案

请把你的code线性布局

 <?XML版本=1.0编码=UTF-8&GT?;< LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android机器人:layout_width =FILL_PARENT机器人:layout_height =FILL_PARENT机器人:方向=垂直>< com.example.android.softkeyboard.LatinKeyboardView机器人:ID =@ + ID /键盘机器人:layout_alignParentBottom =真机器人:layout_width =match_parent机器人:layout_height =WRAP_CONTENT/><键盘机器人:keyWidth =10便士%机器人:keyHeight =50像素机器人:horizo​​ntalGap的=2px的安卓的verticalGap =2px的><行机器人:keyWidth =32PX><关键的android:keyLabel =A/>...< /行>...< /键盘>< / LinearLayout中> 
用eclipse打开xml文件出现的是这种视图,怎么才能已编辑的方式打开

I am trying to code a softkeyboard for 2.1 and up when I code ( see code below) in the main.xml graphical view is displays nothing and says No XML content. Please add a root view or layout to your document" I have tried to place the code in textview but still no luck I can not get the softkeyboard to show at all, its as if my code is being ignored..I have tried these two codes separately nothing works

<com.example.android.softkeyboard.LatinKeyboardView
xmlns:android="http://schemas.android.com/apk/res/android"

    android:id="@+id/keyboard"
    android:layout_alignParentBottom="true"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
/>
<Keyboard
    android:keyWidth="%10p"
    android:keyHeight="50px"
    android:horizontalGap="2px"
    android:verticalGap="2px" >
   <Row android:keyWidth="32px" >
   <Key android:keyLabel="A" />
...
</Row>
...
</Keyboard>

解决方案

Please put your code in a linear layout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<com.example.android.softkeyboard.LatinKeyboardView

android:id="@+id/keyboard"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<Keyboard
android:keyWidth="%10p"
android:keyHeight="50px"
android:horizontalGap="2px"
android:verticalGap="2px" >
<Row android:keyWidth="32px" >
<Key android:keyLabel="A" />
...
</Row>
...
</Keyboard>
</LinearLayout>