Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/114.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UIDocumentPickerViewController正在以阿拉伯语显示翻转的内容_Ios_Swift_Cocoa Touch_Uidocumentpickerviewcontroller - Fatal编程技术网

Ios UIDocumentPickerViewController正在以阿拉伯语显示翻转的内容

Ios UIDocumentPickerViewController正在以阿拉伯语显示翻转的内容,ios,swift,cocoa-touch,uidocumentpickerviewcontroller,Ios,Swift,Cocoa Touch,Uidocumentpickerviewcontroller,这是我打开文档选择器的方式 func openDocuments(){ let documentPicker = UIDocumentPickerViewController(documentTypes: ["public.data"],in: .import) documentPicker.delegate = self documentPicker.modalPresentationStyle = .fullScreen se

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

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

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

    }
注意单元格是如何翻转标签的

附言:

我有

UIView.appearance().semanticContentAttribute = .forceRightToLeft
因为我正在开发的应用程序只使用阿拉伯语

一个简单的

documentPicker.view.semanticContentAttribute = .forceLeftToRight
修正了这个问题,但我还是觉得很奇怪。

一个简单的例子

documentPicker.view.semanticContentAttribute = .forceLeftToRight
let documentPicker = UIDocumentPickerViewController(documentTypes: [String(kUTTypePDF)], in: .import)
documentPicker.delegate = self
documentPicker.view.semanticContentAttribute = .forceLeftToRight
documentPicker.allowsMultipleSelection = true
self.present(documentPicker, animated: true)

修复了这个问题,但我仍然觉得很奇怪。

据我所知,将强制语义应用于
UIView.appearance()
会将其应用于所有视图,因此需要将其应用于各个视图。我没有开发或本地化具有从右到左语义的语言的经验,但如果用户使用阿拉伯语作为设备语言,用户的设备不应该自动管理这些语言吗?据我所知,使用
UIView.appearance()应用强制语义将其应用于所有视图,因此,您需要在必要时将其应用于各个视图。我没有开发或本地化具有从右到左语义的语言的经验,但是如果用户使用阿拉伯语作为设备语言,用户的设备不应该自动管理这些语言吗?欢迎使用堆栈溢出,尽管这可能会回答这个问题,最好给出解释,而不仅仅是答案的代码。欢迎使用堆栈溢出,虽然这可能会回答问题,但最好给出解释,而不仅仅是答案的代码。
let documentPicker = UIDocumentPickerViewController(documentTypes: [String(kUTTypePDF)], in: .import)
documentPicker.delegate = self
documentPicker.view.semanticContentAttribute = .forceLeftToRight
documentPicker.allowsMultipleSelection = true
self.present(documentPicker, animated: true)