我正在编写依赖于显示软件键盘的 UITests。由于 CI 每次都会在全新的模拟器上启动测试,该模拟器已连接硬件键盘,因此不会提供软件键盘。
是否可以设置一些设置(可能在架构中?)以强制禁用模拟器连接硬件键盘。
我正在使用 Cucumber/appium 运行测试。
我正在尝试为UIPickerView组件设置可访问性标签,但从未调用过委托方法。更重要的是,UIInspector 显示pickerView 不可访问,但它实际设置了标签。
数据源/委托方法被触发。只有UIAccessibilityDelegate不是。
在 xcode 10.1 iOS 12.1 模拟器上测试
class ViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate, UIPickerViewAccessibilityDelegate {
@IBOutlet weak var pickerView: UIPickerView!
override func viewDidLoad() {
super.viewDidLoad()
pickerView.isAccessibilityElement = true
pickerView.accessibilityLabel = "TESTAccLabel"
}
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return 5
}
func numberOfComponents(in pickerView: UIPickerView) -> Int {
return 2
}
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
return "\(component) - \(row)"
}
func …Run Code Online (Sandbox Code Playgroud) 我已经为我的 iOS 项目配置了 2 个目标和几个配置(第一个目标为 6 个,第二个目标为调试和发布)。
每个版本配置都有不同的 bundleID,因此选择了适当的临时分发配置文件(在gym 命令中):
desc "Build target1-config1"
lane :deployTarget1 do
gym(
workspace: "myProj-ios.xcworkspace",
scheme: "target1-config1",
configuration: "target1-Release",
export_method: "ad-hoc",
export_options: {
provisioningProfiles: {
"com.target1.config1" => "AdHocProvProfile1"
}
},
output_directory: "./build",
output_name: "target1-config1.ipa"
)
firebase_app_distribution(
app: "xxxxxxxx",
groups: "ios_app_testers",
release_notes: "Automatic dev build from develop",
firebase_cli_path: "/usr/local/bin/firebase",
debug: true
)
end
Run Code Online (Sandbox Code Playgroud)
尝试使用 AdhocProvProfile2 构建 target2 时,收到错误消息。看起来 fastlane 没有正确选择 provProfile(和 bundleID!)。此外,在项目设置中正确选择了配置文件。什么可能导致问题?没有外部健身房文件。
There seems to be a mismatch between your provided `export_method` in gym
[11:15:55]: and the …Run Code Online (Sandbox Code Playgroud) 我正在为 iOS 实现暗模式。图像出现问题:
不幸的是,在 xcode 中覆盖环境界面样式时,图像不会被重绘。
我已经尝试在我的 viewController 中捕获 traitCollectionDidChange 方法并且它被正确调用。我可以设置新图像(origImage_dark),但它不应该是自动的吗?这就是资产设置的目的。我正在使用图像的 .alwaysOriginal 渲染。
我正在尝试画简单UIView的CGContext. 我正在正确绘制字符串,但未UIView绘制字符串。
绘制视图的方法:
view.draw(view.layer, in: context)
Run Code Online (Sandbox Code Playgroud)
但这不起作用。还有其他方法可以画aUIView吗CGContext?
import UIKit
import CoreGraphics
let contextSize = CGSize(width: 400, height: 400)
UIGraphicsBeginImageContextWithOptions(contextSize, false, 0.0)
guard let context = UIGraphicsGetCurrentContext() else {
fatalError("no context")
}
let size = CGSize(width: 30, height: 20)
let point = CGPoint(x: 20, y: 240)
let rect = CGRect(origin: point, size: size)
let text = "TEST"
let paragraphStyle = NSMutableParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle
paragraphStyle.minimumLineHeight = UIFont.systemFont(ofSize: 6).lineHeight
paragraphStyle.lineBreakMode = .byWordWrapping
paragraphStyle.alignment …Run Code Online (Sandbox Code Playgroud) ios ×5
swift ×2
xcode ×2
appium ×1
cgcontext ×1
cucumber ×1
fastlane ×1
ios-darkmode ×1
uikit ×1
uipickerview ×1