gpt4 book ai didi

android - 在 EditText 中输入 "ae"自动变成 æ

转载 作者:可可西里 更新时间:2023-11-01 03:46:57 25 4
gpt4 key购买 nike

我刚刚继承了一些 android 代码,我遇到的第一个错误是一个奇怪的 EditText 问题,当我依次输入字母“a”和“e”时,EditText 会自动将它们合并到字符“æ”中.完整的 xml 声明如下:

<EditText
android:id="@+id/editFirstname"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/profile_edittext_selector"
android:ems="10"
android:inputType="textCapSentences"
android:paddingBottom="6dp"
android:paddingLeft="15dp"
android:paddingRight="5dp"
android:paddingTop="5dp"
android:textColor="#666666"
android:textColorHint="#666666"
android:textSize="12sp" >
</EditText>

我使用 xml 搜索了相关的 Activity 和 Fragment,但我没有发现任何可以指责的东西 - 没有 TextWatcher 也没有任何试图修改输入或 EditText 内的字符序列的例程。输入语言是使用默认值(设置为英语-美国)。

奇怪的是,应用的 iOS 版本中出现了同样的错误(不同的开发者,也不知道为什么会发生)。

有人遇到过这个吗?

编辑:可绘制声明,按要求:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">\
<item android:drawable="@drawable/bgd_form_selected" android:state_pressed="true"/>
<item android:drawable="@drawable/bgd_form_selected" android:state_focused="true"/>
<item android:drawable="@drawable/bgd_form"/>
</selector>

编辑2:

附加信息:- 发生在所有测试设备上:gs2、gs3、xperia z、nexus 4、galaxy ace

  • 如上所述:在 iOS 上提交的相同错误

  • 重要:提交值时服务器会收到正确的输入(例如,“ae”未转换)(这可能会将其缩小为显示问题)

最佳答案

你写道:

The weird thing is, the same bug is filed in the iOS version of the app (different dev, also no clue as to why it's happening).

所以我想知道你是否添加了一个 buggy version of the font Roboto应用程序的 Assets 。它包含错误的连字规则,将“ae”更改为“æ”:

  <Lookup index="1">
<LookupType value="4"/>
<LookupFlag value="0"/>
<!-- SubTableCount=1 -->
<LigatureSubst index="0" Format="1">
<LigatureSet glyph="a">
<Ligature components="e" glyph="ae"/>
</LigatureSet>
<LigatureSet glyph="f">
<Ligature components="i" glyph="fi"/>
</LigatureSet>
</LigatureSubst>
</Lookup>

它已经修复,因此您的问题可能会通过更新应用 Assets 中的 Roboto 字体来解决。

关于android - 在 EditText 中输入 "ae"自动变成 æ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21274166/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com