Android 在Android 23增加了UndoManager撤销相关的处理,EditText可以使用android:allowUndo来配置是否支持撤销的功能。
当我们的设备连接了实体键盘,可以通过crl+z来撤销输入。(TextView with the default Control-Z undo behavior.)
可以参考
http://androidxref.com/8.0.0_r4/xref/development/samples/ApiDemos/src/com/example/android/apis/content/TextUndoActivity.java
http://androidxref.com/8.0.0_r4/xref/development/samples/ApiDemos/res/layout/text_undo.xml
<EditText android:id="@+id/undo_disabled_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium"
android:freezesText="true"
android:allowUndo="false">
</EditText>
EditText的android:allowUndo默认值是true
分享到:
相关推荐
fFlags := FOF_ALLOWUNDO; pTo := Nil; end; if SHFileOperation(fileStruct) = 0 then begin ShowMessage('删除成功。'); end else ShowMessage('删除失败。'); end; end;
FileOp.fFlags = FOF_ALLOWUNDO | FOF_NOERRORUI; if ( ::SHFileOperation( &FileOp ) == 0 ) ::MessageBox( NULL, _T("操作成功"), _T("提示"), MB_OK|MB_ICONINFORMATION ); else ::MessageBox( NULL, _T("操作...
function RecycleFile(sFileName:string):Boolean; var FOS:TSHFileOpStruct; begin FillChar(FOS,SizeOf... fFlags:=FOF_ALLOWUNDO; //移入回收站,而不是物理删除 end; Result:=(SHFileOperation(FOS)=0); end;
- FOF_ALLOWUNDO - 允许恢复 - FOF_FILESONLY - 如果使用了*.*,只操作文件。 - FOF_MULTIDESTFILES - pTo成员可以为多个目的文件。 - FOF_NOCONFIRMATION - 不显示确认对话框。 - FOF_NOCONFIRMMKDIR - 不...
VB6.0使用API拷贝文件显示进度条,api拷贝文件并出现进度条,同时还有删除、替换文件的功能,具体实现的功能: 将当前目录中的FileTG.frm文件复制... 将fFlags设置为FOF_ALLOWUNDO 允许被删除的文件放置到回收站中
.fFlags = FOF_ALLOWUNDO End With If SHFileOperation(DelFileOp) Then ' MsgBox Err.LastDllError Else If DelFileOp.fAnyOperationsAborted Then MsgBox "Operation Aborted" End If End Sub