【发布时间】:2020-09-05 23:19:47
【问题描述】:
我正在尝试从启动我的键盘的View 访问一些属性。例如,如果我的应用中有以下视图:
<EditText
android:contentDescription="content description"
android:privateImeOptions="private ime options" />
我可以像这样从InputMethodService 访问privateImeOptions:
@Override
public void onStartInputView(EditorInfo info, boolean restarting) {
final String privateImeOptions = info.privateImeOptions;
}
但是我不能以同样的方式访问contentDescription 属性。
有没有一种方法可以读取特定属性,例如启动 IME 的 View 的 contentDescription?我只需要对该属性的读取权限,不需要更改它。
【问题讨论】: