Skip to content

Instantly share code, notes, and snippets.

@Orange168
Created September 9, 2018 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Orange168/e61520b210f9fe57d7c5d67411a48447 to your computer and use it in GitHub Desktop.
Save Orange168/e61520b210f9fe57d7c5d67411a48447 to your computer and use it in GitHub Desktop.
[获取xml属性值] #UI#Android
final TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.DialogPreference, defStyleAttr, defStyleRes);
mDialogTitle = TypedArrayUtils.getString(a, R.styleable.DialogPreference_dialogTitle,
R.styleable.DialogPreference_android_dialogTitle);
mDialogIcon = TypedArrayUtils.getDrawable(a, R.styleable.DialogPreference_dialogIcon,
R.styleable.DialogPreference_android_dialogIcon);
mDialogLayoutResId = TypedArrayUtils.getResourceId(a,
R.styleable.DialogPreference_dialogLayout,
R.styleable.DialogPreference_android_dialogLayout, 0);
a.recycle();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment