android - GradientDrawable change angle programmatically -
i have following xml gradientdrawable. how can change angle programmatically?
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:type="linear" android:angle="45" android:startcolor="#ff0000" android:endcolor="#00ff00" /> </shape>
gradientdrawable has method called: .setorientation(gradientdrawable.orientation orientation)
, can change orientation of gradient this. need inflate xml gradientdrawable.
Comments
Post a Comment