How can I set an accessibility trait for the placeholder text in UITextField?

前端 未结 3 888
旧巷少年郎
旧巷少年郎 2021-01-17 22:09

I\'m going through our iOS app to fix accessibility issues. One of the features of the app is a UITextField in which the user can enter search queries. I\'ve set the trait

3条回答
  •  情深已故
    2021-01-17 22:52

    You can't. Traits only make sense on Accessibility Elements. For your UITextField to be "static text" is probably not correct. Setting the trait on the item within the text field will have no effect, even though it may be valid code.

    What you can do, is edit the accessibilityLabel of the control.

提交回复
热议问题