我们在项目中有一个带有"Key"元素的键盘,这个Key元素具有android:codes ="119",android:keyLabel ="w"等属性.
我的问题是如何包含一个自定义属性,如"android:alternativeKeyLabel"来做其他事情.
在自定义中TextView我试图获取text属性的值(例如).
TypedArray values = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.TextView);
String text = values.getString(com.android.internal.R.styleable.TextView_text);
Run Code Online (Sandbox Code Playgroud)
但我收到此错误消息:
包com.android.internal.R不存在
那么如何检索TextView的"默认"属性?
android textview android-custom-view android-custom-attributes