Android EditText光标下的浮动白色框
更新:Android EditText光标下的浮动白色框,android,android-edittext,Android,Android Edittext,更新: 我尝试在EditText上设置android:cursorVisible=“false”,它使白色框消失,但也使闪烁的光标和绿色圆圈消失,但我希望它们保持可见 在我的光标下有一个奇怪的白色盒子。每当我点击该字段时,就会出现一个大的绿色圆圈(在光标下,闪烁着|东西)以及它下面的白色框。几秒钟后,大绿色圆圈和白色方框都消失了。我怎样才能摆脱那个白色的盒子?我想除了原色和强调色之外,我在styles.xml中没有任何变化 在我的styles.xml中,我只需删除android:
我尝试在EditText上设置android:cursorVisible=“false”,它使白色框消失,但也使闪烁的光标和绿色圆圈消失,但我希望它们保持可见
在我的光标下有一个奇怪的白色盒子。每当我点击该字段时,就会出现一个大的绿色圆圈(在光标下,闪烁着|东西)以及它下面的白色框。几秒钟后,大绿色圆圈和白色方框都消失了。我怎样才能摆脱那个白色的盒子?我想除了原色和强调色之外,我在styles.xml中没有任何变化
在我的
styles.xml
中,我只需删除android:popupBackground
的xml属性,然后白框就消失了
<resources>
<style name="Theme.MyApp.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:popupBackground">@android:drawable/dialog_holo_light_frame</item>
</style>
</resources>
@android:drawable/dialog\u holo\u light\u框架
我相信这是位置选择器,请检查我尝试在EditText上设置android:cursorVisible=“false”
,它使白色框消失,但也使闪烁的光标和绿色圆圈消失,但我希望它们保持可见。可能您必须为EditText设置自定义资源
mAltPhoneField.setText(person.getPhoneAlternate());
InputFilter[] phoneFilterArray = new InputFilter[2];
phoneFilterArray[0] = TextUtilities.getPhoneFilter();
phoneFilterArray[1] = new InputFilter.LengthFilter(14);
mAltPhoneField.setFilters(phoneFilterArray);
mAltPhoneField.addTextChangedListener(new PhoneNumberFormattingTextWatcher() {
@Override
public void afterTextChanged(Editable s) {
super.afterTextChanged(s);
mObj.getPerson().modifyPhoneAlternate(s.toString());
}
});
mAltPhoneField.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (!hasFocus) {
hasValidAltPhone();
}
}
});
private boolean hasValidAltPhone() {
return hasValidPhoneNumber(mAltPhoneField);
}
private boolean hasValidPhoneNumber(EditText field) {
boolean isValidPhone = true;
if (!TextUtils.isEmpty(field.getText())) {
isValidPhone = TextUtilities.isValidPhoneNumber(field.getText().toString());
if (!isValidPhone) {
field.setError(getString(R.string.invalid_phone_error));
}
}
return isValidPhone;
}
<resources>
<style name="Theme.MyApp.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:popupBackground">@android:drawable/dialog_holo_light_frame</item>
</style>
</resources>