私はサポートlibにバージョン24.2.1を使用しています、とAppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
AppCompatDrawableManager.get()VectorDrawableCompat.create対()
をサポートベクトルを有効にしているサポートベクトルに関するこれらの機能の違いは何ですか?私はVectorDrawableCompat.create(getResources(), R.drawable.my_vector, null)
を使用していました。プログラムでそのようなボタンの上に描画可能に設定するときしかし、これは私のテストデバイス(アンドロイド4.3)に描画可能を生成しません。(状態リストセレクタに包まれた)AppCompatDrawableManager.get().getDrawable(getActivity(), R.drawable.my_vector);
を使用して
button.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null);
は大丈夫動作しているようです、私はそれのためのドキュメントを見つけるように見えることはできません。
'AppCompatDrawableManager'が隠されている、使用' AppCompatResources#getDrawable'代わり – pskink
@pskink 'AppCompatResources.getDrawable(...)' 24.xxにinstroduced 'AppCompatDrawableManager.get(へのパブリックAPIのショートカットです)。getDrawable(。 ..) '早く利用可能です。 –