importUIKitimportXHToastSwiftclassBindFrameNumAlertVC:BaseAlertVC,UITextFieldDelegate{let textField =UITextField()functextField(_ textField:UITextField, shouldChangeCharactersIn range:NSRange, replacementString string:String)->Bool{// Get the new text after the user enters or deletes characterslet newText =(textField.text asNSString?)?.replacingCharacters(in: range, with: string)??""// Limit the text field to 15 charactersreturn newText.count <=15}overridefuncviewDidLoad(){super.viewDidLoad()centerView.backgroundColor =.whitecenterView.snp.makeConstraints { make inmake.width.equalTo(300)make.height.equalTo(250)make.center.equalToSuperview()}centerView.layer.cornerRadius =10let titleLabel =UILabel()centerView.addSubview(titleLabel)titleLabel.text =LocalizableManager.localValue("binding_frame_number")titleLabel.snp.makeConstraints { make inmake.centerX.equalToSuperview()make.top.equalToSuperview().offset(20)}textField.delegate =selftextField.backgroundColor =UIColor.rgbColor(red:219, green:219, blue:219)textField.keyboardType =.numberPadtextField.textAlignment =.centercenterView.addSubview(textField)textField.snp.makeConstraints { make inmake.centerX.equalToSuperview()make.width.equalTo(220)make.height.equalTo(50)make.top.equalTo(titleLabel.snp_bottom).offset(30)}textField.layer.cornerRadius =10//限制textField只能输入15个字符let alertLabel =UILabel()alertLabel.numberOfLines =0alertLabel.font =UIFont(name:"PingFang SC", size:13)alertLabel.textColor =.grayalertLabel.text =LocalizableManager.localValue("input_corresponding_code")centerView.addSubview(alertLabel)alertLabel.snp.makeConstraints { make inmake.top.equalTo(textField.snp_bottom).offset(10)make.left.equalTo(textField).offset(10)make.right.equalTo(textField)}let sureBtn =UIButton()sureBtn.backgroundColor =UIColor.rgbColor(red:219, green:219, blue:219)sureBtn.setTitleColor(.black,for:.normal)sureBtn.addTarget(self, action:#selector(sureBtnClick),for:.touchUpInside)sureBtn.setTitle(LocalizableManager.localValue("sure"),for:.normal)centerView.addSubview(sureBtn)sureBtn.snp.makeConstraints { make inmake.left.equalToSuperview().offset(30)make.bottom.equalToSuperview().offset(-20)make.width.equalTo(100)make.height.equalTo(40)}sureBtn.layer.cornerRadius =20let cancelBtn =UIButton()cancelBtn.backgroundColor = newUIYellowcancelBtn.addTarget(self, action:#selector(cancelBtnClick),for:.touchUpInside)cancelBtn.setTitle(LocalizableManager.localValue("cancel"),for:.normal)centerView.addSubview(cancelBtn)cancelBtn.snp.makeConstraints { make inmake.right.equalToSuperview().offset(-30)make.bottom.equalToSuperview().offset(-20)make.width.equalTo(100)make.height.equalTo(40)}cancelBtn.layer.cornerRadius =20}@objcfuncsureBtnClick(){print(textField.text)guardlet str = textField.text,str.count ==15else{XHToast.showBottomWithText(LocalizableManager.localValue("input_only_six_num"))return}}@objcfunccancelBtnClick(){}}
选中支持 USB 网络设备驱动,如下图所示:
[*] Device Drivers→
*- Network device support →
USB Network Adapters→
{*} Multi-purpose USB Networking Framework 将光标移动到 save 保存,如下图所示: 保存到 arch/arm64/c…
ARiADNE:A Reinforcement learning approach using Attention-based Deep Networks for Exploration 文章目录 ARiADNE:A Reinforcement learning approach using Attention-based Deep Networks for Exploration机器人自主探索(ARE)ARE的传统边界法非短视路径深度强化学习的方…