Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/215.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,我想做以下事情:不能调整EditText小部件的大小。因为当我输入一个长字符串时,我所有的布局结构都崩溃了,因为EditText占据了整个屏幕。有什么建议吗?首先定义滚动,然后定义布局,然后定义编辑文本。像这样 <?xml> <ScrollView> <LinerLayout> <EditText/> <LinerLayout/> </ScrollView> 我希望您能找到解决方案。首先定义滚动,然后定义布局,然后定义

我想做以下事情:不能调整EditText小部件的大小。因为当我输入一个长字符串时,我所有的布局结构都崩溃了,因为EditText占据了整个屏幕。有什么建议吗?

首先定义滚动,然后定义布局,然后定义编辑文本。像这样

<?xml>
<ScrollView>
<LinerLayout>
<EditText/>
<LinerLayout/>
</ScrollView>


我希望您能找到解决方案。

首先定义滚动,然后定义布局,然后定义编辑文本。像这样

<?xml>
<ScrollView>
<LinerLayout>
<EditText/>
<LinerLayout/>
</ScrollView>


我希望你能找到解决办法。

将编辑文本放在一行中。。这里有一个例子

 <EditText android:id="@+id/InscripChampNom"
           android:layout_height="wrap_content" 
           android:textSize="14px"
           android:inputType="textPersonName" 
           android:layout_marginRight="20dip"

           android:singleLine="true" ---->HERE

           android:textColor="@color/background">

  </EditText>
这里
android:textColor=“@color/background”>

使编辑文本在一行中。。这里有一个例子

 <EditText android:id="@+id/InscripChampNom"
           android:layout_height="wrap_content" 
           android:textSize="14px"
           android:inputType="textPersonName" 
           android:layout_marginRight="20dip"

           android:singleLine="true" ---->HERE

           android:textColor="@color/background">

  </EditText>
这里
android:textColor=“@color/background”>

同时使用singleLine和Layoutwidth(具有固定大小)属性。 见此:

<EditText 
    android:text="ok" 
    android:id="@+id/EditText01" 
    android:layout_width="300dip" 
    android:layout_height="wrap_content"
    android:singleLine="true"
    ></EditText> 


试试这个。

同时使用singleLine和Layoutwidth(具有固定大小)属性。 见此:

<EditText 
    android:text="ok" 
    android:id="@+id/EditText01" 
    android:layout_width="300dip" 
    android:layout_height="wrap_content"
    android:singleLine="true"
    ></EditText> 


试试这个。

我试过“单线”,如果我不使用虚拟键盘,它可以正常工作。如果我真的有它,它会变得一团糟。虚拟键盘有什么问题?怎么会搞得一团糟?你能给我一些快照吗?对不起,我很抱歉。事实并非如此。但是如果我单独使用“单行线”,编辑文本的宽度就会被拉伸,所以我想我必须使用“单行线”+类似于“layout_width=“40dp”的东西。对我来说,这不是最好的解决方案,因为我认为安卓系统有“Android:constraint=“true”之类的东西,仅此而已,但似乎没有。不过,我也会玩ScrollView。我试过“单线”,如果我不使用虚拟键盘,它就可以正常工作。如果我真的有它,它会变得一团糟。虚拟键盘有什么问题?怎么会搞得一团糟?你能给我一些快照吗?对不起,我很抱歉。事实并非如此。但是如果我单独使用“单行线”,编辑文本的宽度就会被拉伸,所以我想我必须使用“单行线”+类似于“layout_width=“40dp”的东西。对我来说,这不是最好的解决方案,因为我认为安卓系统有“Android:constraint=“true”之类的东西,仅此而已,但似乎没有。不过,我也会玩ScrollView。