change corner radius of drawable programmatically

hallrain

New Member
I have a shape which defined in the xml:\[code\]<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#FFFF0000" android:endColor="#80FF00FF" android:angle="45"/> <padding android:left="7dp" android:top="7dp" android:right="7dp" android:bottom="7dp" /> <corners android:bottomLeftRadius="5dp" ##this need change android:bottomRightRadius="5dp" ##this need change android:topLeftRadius="5dp" ##this need change android:topRightRadius="5dp" /> ##this need change</shape>\[/code\]This codeI am creating object \[code\]Drawable shape = getResource().getDrawable(R.drawable.myshape);\[/code\]and i need change (or create with changed corner radius).How can i change radius?How can i create shape programmatically?
 
Back
Top