我有一個包含多個按鈕設置的UIActionsheet。我將如何去添加一個撤消功能?我正在使用UITextfieldsUIActionSheet中的撤消按鈕
0
A
回答
0
設置適當的UIActionSheet按鈕,在所需的UITextField的NSUndoManager
對象上調用undo
方法。對於iOS 3.0及更高版本中的所有UITextField和UITextView對象,都有一個可以訪問並用於管理撤消和重做操作的對象undoManager
。必要的代碼會去是這樣的:
(UIActionSheetDelegate方法實現)
- (void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == /*undo index*/)
[yourTextField.undoManager undo];
}
編輯:我建議你看看Apple documentation for Undo Managers,應該進一步與這個如果你需要它幫助你。
0
相關問題
- 1. PHP撤消按鈕
- 2. 取消iPad上的UIActionSheet上的按鈕
- 3. 撤消按鈕點擊
- 4. 取消按鈕和UIActionSheet的問題
- 5. 在UIActionSheet取消按鈕不顯示iPhone?
- 6. UIActionSheet,取消按鈕運行方法
- 7. 添加UIActionSheet無取消按鈕
- 8. UIActionSheet動態按鈕
- 9. UIActionSheet按鈕的顏色
- 10. 帶禁用按鈕的UIActionSheet?
- 11. NSUndoManager - 撤消按鈕不顯示
- 12. 連接4 Java遊戲撤消按鈕
- 13. 繪圖應用程序撤消按鈕
- 14. NSUndoManager和啓用/禁用撤消按鈕
- 15. 在底部的UIActionSheet中放置取消按鈕
- 16. 從UIActionSheet中處理取消按鈕的更優雅方式?
- 17. 如何在xamarin中禁用/取消撤消按鈕
- 18. 按日期撤消
- 19. UIActionSheet按鈕插入到新的ViewController中
- 20. 如何禁用UIActionSheet中的按鈕?
- 21. 如何更改UIActionsheet中的按鈕
- 22. UIActionSheet - 添加禁用按鈕
- 23. UIActionSheet按鈕顏色問題
- 24. 使綠色UIActionSheet按鈕?
- 25. UIActionSheet按鈕不起作用
- 26. 啓用後退按鈕以充當Ajax應用程序中的「撤消」按鈕
- 27. Excel撤銷按鈕
- 28. IOS UIActionSheet取消按鈕不工作的權利
- 29. UIActionSheet取消按鈕不斷崩潰我的應用程序
- 30. iPad上的UIActionSheet不顯示取消按鈕
我有一切設置按鈕索引,我仍然有問題得到這個東西的工作。 – TWcode