Giter VIP home page Giter VIP logo

Comments (3)

yoferzhang avatar yoferzhang commented on May 24, 2024

如需其他信息,可以同样英文名司内企微联系

from qmui_ios.

youjone avatar youjone commented on May 24, 2024

我也遇到这个问题,我是密码输入框有这个问题,普通输入框没有,你解决了吗?

from qmui_ios.

MoLice avatar MoLice commented on May 24, 2024

根据 flutter 源码 FlutterTextInputPlugin.mm#L749-L776FlutterSecureTextInputView 继承自 FlutterTextInputView,而 FlutterTextInputView 继承自 UIView,所以本质上 FlutterSecureTextInputView 是一个普通 view,并非输入框。

然后 flutter 为了让 FlutterSecureTextInputView 以输入框的身份存在,它重写了 isKindOfClass:,在里面对 UITextField 返回 YES,于是在 FlutterSecureTextInputView 初始化的时候,会走进去 QMUITheme 这个 if 判断里,QMUIThemePrivate.m#L150 ,然后试图为它注册一个任意 UITextField 都拥有的方法 attributedText

但由于 FlutterSecureTextInputView 是假的 UITextField,且它伪装的手段也没写完整(应该重写 respondsToSelector:),所以就导致命中 assert。

综上所述,结论是这属于 flutter 的 bug,你们可以提 issue 给他们,QMUI 后续版本也不会为其写任何兼容代码。

在此之前,也可以在业务项目里通过 runtime 给 FlutterSecureTextInputView 动态添加一个叫 attributedText 的方法,里面什么都不用做,就可以避开这种问题。

from qmui_ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.