我已经创造了一种在用户输入一个电话number.How的EntryElement我可以在元素的末尾添加一个按钮,以便用户可以按下按钮并拨打电话?添加按钮EntryElement
回答
您需要创建一个新的元素是EntryElement的子类,重写获得Cell方法,并添加到accessoryView的按钮。
我不知道如何在对话完成后回到应用程序,然后看看这个。 http://stackoverflow.com/questions/9264065/is-it-possible-to-go-back-automatically-into-the-application-after-calling-a-num – MemoDreamer 2012-03-07 08:25:35
小区的物业accessoryView的是空。相反,我将该按钮添加到单元格的子视图中,作为_cell.Subviews [0] .AddSubview(btn)'。这是一样的吗? – 2012-03-13 10:19:25
我知道这并不完全回答这个问题,但我奋斗了很长一段时间,直到我发现@Janub的答案,让我在正确的轨道上。这是我目前正在工作的代码。
public class NextNumericCell : EntryElement
{
readonly EventHandler handler;
public NextNumericCell (string caption, string placeholder, string value, EventHandler onClick) : base(caption,placeholder,value)
{
handler = onClick;
}
protected override UITextField CreateTextField (CGRect frame)
{
var textField = base.CreateTextField (frame);
var toolBar = new UIToolbar (new CGRect (0, 0, frame.Width, 35));
var spacerButton = new UIBarButtonItem (UIBarButtonSystemItem.FlexibleSpace);
var buttonTitle = ReturnKeyType == null ? "SetButtonTitle" : ReturnKeyType.ToString();
var nextButton = new UIBarButtonItem (buttonTitle, UIBarButtonItemStyle.Plain, handler);
toolBar.Items = new UIBarButtonItem [] { spacerButton, nextButton };
textField.InputAccessoryView = toolBar;
return textField;
}
}
- 1. 添加按钮
- 2. 添加按钮
- 3. 添加按钮
- 4. 添加按钮
- 5. 添加按钮
- 6. Android添加按钮
- 7. 添加TR按钮
- 8. 按钮添加列?
- 9. 添加按钮android.view.View
- 10. 基于按钮值添加类按钮
- 11. 添加自定义按钮的UITabBarController(中间添加按钮)
- 12. jquery添加id到按钮时,动态添加按钮
- 13. 当鼠标悬停在按钮上时,按钮添加按钮
- 14. 向页面添加按钮
- 15. 添加栏按钮项目
- 16. 添加右按钮在NavigationController
- 17. 动态添加按钮(jQuery)
- 18. UserForm - 添加停止按钮
- 19. GtkNotebook添加标签按钮
- 20. 添加按钮到网站
- 21. 将按钮添加到jtable
- 22. 将按钮添加到UITableView
- 23. 添加按钮到标签
- 24. 添加按钮的navigationcontroller
- 25. UIActionSheet - 添加禁用按钮
- 26. 在tabbarcontroller上添加按钮
- 27. 未添加java - 按钮
- 28. JQGrid添加默认按钮
- 29. FPDF添加按钮返回
- 30. 添加按钮动作条
为什么不作出回答而不是评论?这正是要做的事情! – Krumelur 2012-03-06 18:36:43