开发者

What is the purpose of setContentDescription() of a view?

开发者 https://www.devze.com 2023-04-04 07:16 出处:网络
I was in a dialemma on how to associate a string information to 开发者_JAVA百科a view. I came across two methods

I was in a dialemma on how to associate a string information to 开发者_JAVA百科a view. I came across two methods

setTag()

and

setContentDescription()

Both served my purpose.

I know that setTag() is used in this cases generally. But when is setContentDescription() method used? , what is exact purpose of setContentDescription()?


Screen readers are used by those with impaired vision. “Accessibility” is a standard term for facilitating access by users with some kind of disability.


But when is setContentDescription() method used?

From the docs, setContentDescription() allows you to associate a textual description to the view. The docs state that it's primarily used to support accessibility, so I assume it's there to support screen readers.

0

精彩评论

暂无评论...
验证码 换一张
取 消