gpt4 book ai didi

ios - UIDocumentPickerViewController 以阿拉伯语显示翻转的内容

转载 作者:行者123 更新时间:2023-11-28 07:18:48 25 4
gpt4 key购买 nike

这是我打开文档选择器的方式

func openDocuments(){
let documentPicker = UIDocumentPickerViewController(documentTypes: ["public.data"],in: .import)
documentPicker.delegate = self
documentPicker.modalPresentationStyle = .fullScreen

self.present(documentPicker, animated: true) {
}

}

注意单元格如何翻转标签

enter image description here

附言:

我有

UIView.appearance().semanticContentAttribute = .forceRightToLeft

因为我正在开发的应用程序只有阿拉伯语

最佳答案

在呈现 UIDocumentPickerViewController 之前,请确保 UIDocumentPickerViewController 中的浏览器布局按照设备的布局方向根据语言呈现 UIDocumentPickerViewController

    if Locale.current.languageCode == "ar" {
UIView.appearance(whenContainedInInstancesOf: [UIDocumentBrowserViewController.self]).semanticContentAttribute = .forceRightToLeft
} else {
UIView.appearance(whenContainedInInstancesOf: [UIDocumentBrowserViewController.self]).semanticContentAttribute = .forceLeftToRight
}

关于ios - UIDocumentPickerViewController 以阿拉伯语显示翻转的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58790671/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com