Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/189.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android中滚动视图中的编辑文本_Android_Android Edittext - Fatal编程技术网

android中滚动视图中的编辑文本

android中滚动视图中的编辑文本,android,android-edittext,Android,Android Edittext,我试图创建一个from应用程序,在这个应用程序中我有一个很长的表单,我想在滚动视图中,但是当我向滚动视图添加EditText时..eclipse在其designer视图中显示了一些错误 error! IllegalStateException: ScrollView can host only one direct child Exception details are logged in Window > Show View > Error Log 有人有办法破解吗 在得到上述

我试图创建一个from应用程序,在这个应用程序中我有一个很长的表单,我想在滚动视图中,但是当我向滚动视图添加EditText时..eclipse在其designer视图中显示了一些错误

error!
IllegalStateException: ScrollView can host only one direct child
Exception details are logged in Window > Show View > Error Log
有人有办法破解吗


在得到上述问题的解决方案后,我已包含此代码

现在EditText没有显示任何键入的文本,它只是给出了一些建议

我有以下XML:

<ScrollView
android:id="@+id/widget64"
android:layout_width="320px"
android:layout_height="358px"
android:fillViewport="true"
android:isScrollContainer="true"
android:saveEnabled="true">
<TableLayout
android:id="@+id/widget58"
android:layout_width="320px"
android:layout_height="65px"
android:orientation="vertical"
>
<TableRow
android:id="@+id/widget60"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/user"
android:text="User"
android:textColor="#000000">
</TextView>
</TableRow>
<TableRow
android:id="@+id/widget60"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
>
<EditText
android:id="@+id/users_first_name" 
android:layout_height="fill_parent" 
android:layout_width="fill_parent" 
android:hint="First Name"
android:focusable="true"
android:inputType="textPersonName"
android:enabled="true"
android:ems="15">
</EditText>
</TableRow>
</TableLayout>
</ScrollView>


发现了麻烦。。。。。
我的emulator键设置为中文而不是英文…

首先将任何版面添加到该滚动视图,然后将edittext添加到该版面。然后自动获得该edittext的滚动。例如:将Linearlayout添加到该滚动视图,然后将edittext添加到taht Linearlayout。

是的,
ScrollVew
只能有一个子项。 为了这个,你可以这样做

<ScrollView
   fillViewPortView = "true">

    <RelativeLayout>
          // Design the entire layout in here
          // Put your elements one below the other. It will automatically scroll
          // dont forget to setFillViewPort view to true in ScrollView
    </RelativeLayout>
</ScrollView>

//在这里设计整个布局
//把你的元素一个放在另一个下面。它将自动滚动
//不要忘记在ScrollView中将FillViewport视图设置为true
这肯定会解决问题

希望他的帮助:)

谢谢,是的,它很有效。:)拯救了我的一天…@User333和@javanatori如果选择左侧的复选框有助于接受答案。如果键入的文本没有出现在EditText上,这将有助于其他人。。!您是否正在查看编辑文本,但在按下软键盘上的键后无法看到其中的文本。如果是这样,请检查您可能已更改的文本的颜色。在布局中放置一个简单的默认edittext,无需任何修改即可进行测试。让我知道结果。。。!这里有一些建议…但是它们是用中文或日语写的…左边的clik左边的顶部