【问题标题】:How to have floating label textbox in xamarin ios如何在 xamarin ios 中有浮动标签文本框
【发布时间】:2019-03-15 10:41:21
【问题描述】:

您好,我已尝试集成 MaterialComponentsXamarin,我将在其中动态生成文本框我已应用以下代码,但当我聚焦文本框时看不到浮动标签

TextField text = new TextField();
text.Placeholder = "this is floating label";

【问题讨论】:

  • 你把TextField添加到父视图了吗?
  • @Jason 我已经添加了文本字段并且我可以查看,但我唯一看不到的是焦点上的浮动标签

标签: ios xamarin.ios material-components


【解决方案1】:

您需要使用对您的TextField 的引用来实例化TextInputController 对象之一。

例如:

var _ = new TextInputControllerOutlined(text);

原始的 swift 教程展示了这一点:https://codelabs.developers.google.com/codelabs/mdc-101-swift/#2

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-03
    • 2021-11-30
    • 2020-02-12
    • 1970-01-01
    • 1970-01-01
    • 2019-02-21
    相关资源
    最近更新 更多