gpt4 book ai didi

iphone - 如何使用 MonoTouch 在 UIKeyboard 之上添加 UIToolbar?

转载 作者:行者123 更新时间:2023-12-03 20:22:27 24 4
gpt4 key购买 nike

我遵循 Obj-C 中 Custom iPhone Keyboard 的示例但是,为了在 Windows subview 中查找 UIKeyboard,我不知道如何使用 MonoTouch 来执行此操作。我不知道“描述”是什么。如果它是 UIView 的属性,我无法从 MonoTouch 访问它???

有人可以提供一个在 Obj-C 示例中查找 UIKeyboard 的示例,但在 C# 中用于 MonoTouch 吗?

谢谢。

最佳答案

我假设您正在寻找与 Safari 中的键盘相同的东西(即它顶部有一个小工具栏,可以添加额外的功能,如最右图 here 所示)

在这种情况下,您要寻找的是输入附件 View (iOS 3.2 及更高版本)。在 Monotouch 中,执行此操作的方法是覆盖 View Controller 中的输入附件 View 。我以前用过的一个简单例子

public override UIView InputAccessoryView 
{
get
{
UIView dismiss = new UIView(new RectangleF(0,0,320,27));
dismiss.BackgroundColor = UIColor.FromPatternImage(new UIImage("Images/accessoryBG.png"));
UIButton dismissBtn = new UIButton(new RectangleF(255, 2, 58, 23));
dismissBtn.SetBackgroundImage(new UIImage("Images/dismissKeyboard.png"), UIControlState.Normal);
dismissBtn.TouchDown += delegate {
subjectField.ResignFirstResponder();
};
dismiss.AddSubview(dismissBtn);
return dismiss;
}
}

这只是在键盘顶部创建一个 UIView,然后您可以像平常一样将任何您想要的内容添加到 View 中。

关于iphone - 如何使用 MonoTouch 在 UIKeyboard 之上添加 UIToolbar?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4175212/

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