当我使用autocompletetextview时,一切正常,除了它在两个位置之间切换:正确的一个位于textview下面并且相当低一些.它开始出错,但几乎立即移动到正确的位置.然而,当输入或退格时,这对于每个字母都是非常烦人的.我正在使用android studio.
似乎两个事件同时试图决定布局.有时它会粘在一个位置或另一个位置.
**我使用自定义适配器减慢了过滤过程,看起来当输入文本时它会移动到错误的位置,然后当过滤完成后,它会移回正确的位置.
不正确
正确:
java(在OnCreate()中) -
String[] drugs = new String[]{"Nexium","Amoxicillin","LEVOCETIRIZINE DIHYDROCHLORIDE", "Advil", "Advair Diskus", "Daraprim"};
AutoCompleteTextView drugNameAutoComplete = ((AutoCompleteTextView) findViewById(R.id.drugNameEditText));
drugNameAutoComplete.setAnimation(null);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_dropdown_item_1line,drugs);
drugNameAutoComplete.setAdapter(adapter);
Run Code Online (Sandbox Code Playgroud)
和布局代码 -
<AutoCompleteTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/drugNameEditText"
android:enabled="true"
android:singleLine="true"
android:layout_below="@+id/lookingForView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:dropDownVerticalOffset="50dp"
android:hint="@string/drug_name" />
Run Code Online (Sandbox Code Playgroud)
如果我删除dropDownVeticalOffset,我会在正确的值和此之间闪烁 -
我正在构建一个 nuget 包,一切都很好,直到我尝试使用通配符导入文件夹中的所有 dll。
这很完美
<file src="KL.Ocr.Tesseract/x86/liblept172.dll" target="content\x86"/>
Run Code Online (Sandbox Code Playgroud)
但这没有任何作用
<file src="KL.Ocr.Tesseract/x86/*.dll" target="content\x86"/>
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激(我故意将 dll 放在内容而不是 lib 中,因为那是它们需要的位置)
<?xml version="1.0"?>
<package >
<metadata>
<id>asdf</id>
<version>1.0.0.0</version>
<title>asdf</title>
<authors>asdf</authors>
<owners>asdf</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>asdf </description>
<copyright>Copyright 2016</copyright>
<tags>asdf</tags>
<frameworkAssemblies>
</frameworkAssemblies>
<dependencies>
</dependencies>
</metadata>
<files>
<file src="KL.Pas.Ocr.targets" target="build"/>
<file src="KL.Ocr.Pas.Host/bin/Debug/KL.Ocr.Pas.Host.dll" target="lib/net45" />
<file src="KL.Ocr.Pas.Host/bin/Debug/KL.Ocr.Pas.Worker.exe" target="lib/net45" />
<file src="KL.Ocr.Pas.Host/bin/Debug/KL.Pas.Ocr.Contracts.dll" target="lib/net45" />
<file src="KL.Ocr.Pas.Host/bin/Debug/KL.Ocr.Tesseract.dll" target="lib/net45" />
<file src="KL.Ocr.Pas.Host/bin/Debug/Tesseract.dll" target="lib/net45" />
<file src="KL.Ocr.Tesseract/x64/*.dll" target="build\x64"/>
<file src="KL.Ocr.Tesseract/x86/*.dll" target="build\x86"/>
<file src="KL.Ocr.Tesseract/tessdata/*.*" target="build\tessdata"/>
</files>
</package>
Run Code Online (Sandbox Code Playgroud)