gpt4 book ai didi

ios - 什么指定了 UITextField 的占位符对齐方式?

转载 作者:搜寻专家 更新时间:2023-10-31 19:37:12 30 4
gpt4 key购买 nike

我有一个使用阿拉伯语和英语两种语言的应用程序,

翻转 UI 时使用:

UIView.appearance().semanticContentAttribute = .forceRightToLeft
//And/Or:
UITextField.appearance().semanticContentAttribute = .forceRightToLeft

textFields 的占位符保持不变,据我所知,semanticContentAttribute 只会翻转 Trailing 和 leading 约束。

如果我想通过更改 View 的语义来更改文本字段占位符的对齐方式怎么办?

注意:

我已尝试将 UITextFieldtextAlignment 更改为所有可能的值。

最佳答案

所以尝试做两件事。

  1. 将阿拉伯语添加到您的项目中(点击本地化部分下的 +) enter image description here

  2. 选择对齐字段中的最后一个选项。

enter image description here

关于ios - 什么指定了 UITextField 的占位符对齐方式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42606968/

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