🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
### **1. 多窗口切换** * [ ] 非模式窗体 Form1.Show; * [ ] 模式窗本 Form1.ShowModal; * [ ] 关闭窗体 Form1.Close; ### **2. 退程序** * [ ] MainActivity.finsh; * [ ] Application.MainForm.DisposeOf;//(最小化) * [ ] Application.Terminate * [ ] Close; * [ ] var Intent: JIntent; begin Intent := TJIntent.JavaClass.init(TJIntent.JavaCla Intent.addCategory(TJIntent.JavaClass.CATEGO Intent.setFlags(TJIntent.JavaClass.FLAG_ACTIVI_ SharedActivityContext.startActivity(Intent); end ### **3.自定义程序名称、图标、全屏和可旋转方向** ① 自定义程序名称 Project->Options->Version Info->label(改成需要显示的中文名即可) ,但是需要安装到安卓手机才可以 显示。 ② 全屏显示 Project->Options->Version Info->theme(TitleBar、No TitleBar) ,我是没有感觉出这二个选项有什么不同。 ③ 自定义图标 用平面程序,做好 5 个图片,大小分别为 36、48、72、96、144。放在工程的同目录下面。 Project->Options->Application->Atrwork 中分别选择你的 5 个图片。 PS:图片必须是 PNG 的,要不然一会你无法编译别说我没提醒。 ④ 自定义程序允许旋转的方向 Project->Options->Application->Orientation->Enable custom orientation 打上对号,下面分别为,树立、倒 立、左转、右转。 ### 4.**路径信息及文件和文件夹的操作** * [ ] 通过TPath类获得路径,如 TPath.GetTempFileName; TPath.GetTempPath; TPath.GetHomePath; TPath.GetDocumentsPath; TPath.GetSharedDocumentsPath; TPath.GetLibraryPath; TPath.GetCachePath; * [ ] 文件夹是否存在 if TFile.Exists(TPath.GetTempFileName) then * [ ] 新建目录 TDirectory.CreateDirectory(TPath.GetTempPath + 'NewDirectory'); * [ ] 复制文件 TFile.Copy(sFile1, sFile2 * [ ] 删除文件 var Files: TStringDynArray; I: Integer; begin if TDirectory.Exists(TPath.GetTempPath + '/temp/') then begin Files := TDirectory.GetFiles(TPath.GetTempPath + '/temp/'); for I := 0 to high(Files) do begin TFile.Delete(Files[I]); end; end; end; ### **5.闪光灯的控制** procedure TForm1.Button1Click(Sender: TObject); begin if Button1.Text = '开' then begin CameraComponent1.TorchMode := TTorchMode.tmModeOn;//开灯 Button1.Text := '关'; end else begin CameraComponent1.TorchMode := TTorchMode.tmModeOff;//关灯 Button1.Text := '开'; end; end; procedure TForm1.FormCreate(Sender: TObject); begin Button1.Enabled := CameraComponent1.HasFlash;//如果没有闪光灯,则按钮不起作用 CameraComponent1.Active := True; end;