android:DrawableRightを使用して、ボタンとTextViewでVectorDrawableを使用することは可能ですか?
TextViewまたはImageViewでVectorDrawableアセットを使用すると、「android:DrawableRight」/「android:DrawableEnd」/「android:DrawableStart」/「android:DrawableLeft」を使用すると、ランタイムクラッシュが発生します。 アプリは警告なしで問題なくコンパイルされます。 使ってます Gradle 1.5 サポートライブラリ23.2( 'com.android.support:appcompat-v7:23.2.0') 私が見つけたのは、このようにクラッシュすることなく、プログラムによってJavaでSVGを割り当てることができるということです。 TextView tv = (TextView) findViewById(R.id.textView); tv.setCompoundDrawablesWithIntrinsicBounds(null,null, getResources().getDrawable(R.drawable.ic_accessible_white_36px),null); (これは23.2のサポートライブラリのバグだと思います。) しかし、SVGアセットにdrawableRightなどを使用することは可能ですか? これが私のレイアウトです <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="au.com.angryitguy.testsvg.MainActivity"> <TextView android:id="@+id/textView" android:layout_width="match_parent" android:layout_height="wrap_content" android:drawableRight="@drawable/ic_accessible_white_36px" android:background="@color/colorPrimary" android:textColor="#FFFFFF" android:textSize="22sp" android:text="Hello World!"/> </RelativeLayout> これが私の活動です package au.com.angryitguy.testsvg; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import …