我想知道这种渐变颜色在 android中是否可行? 如果可能的话怎么样? http://www.techandall.com/wp-content/uploads/2013/10/techandall_mobile-analytics-UI-concept_preview1.jpg 谢谢, Bskania. int startColor=Color.parseC
如果可能的话怎么样?
http://www.techandall.com/wp-contenthttp://img.558idc.com/uploadfile/2013/10/techandall_mobile-analytics-UI-concept_preview1.jpg
谢谢,
Bskania.
int startColor=Color.parseColor("#a6c1de"); //you can add as many gradient colors as you want here //and include it in the int array while initializing GradientDrawable int endColor=Color.parseColor("#aa82b7"); GradientDrawable mDrawable=new GradientDrawable(Orientation.LEFT_RIGHT, new int[] startColor,endColor}); LinearLayout mLayout=(LinearLayout)findViewById(R.id.your_id); mLayout.setBackgroundDrawable(mDrawable);