首页 > 解决方案 > 如何在 xamarin ios 中有浮动标签文本框

问题描述

嗨我已经尝试集成MaterialComponentsXamarin我将在其中动态生成文本框我已经应用了以下代码但是当我关注文本框时我看不到浮动标签

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

标签: iosxamarin.iosmaterial-components

解决方案


您需要TextInputController使用对您的TextField.

例如:

var _ = new TextInputControllerOutlined(text);

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


推荐阅读