开发者

WindowBackground: Image with selected color

I want to have as the background of my application an image, with a color the user can choose. The picture has got a transparent background and so I would like to put it ove开发者_JS百科r a colorous screen. Is that possible?

Thanks a lot :)


yes it is possible. For example create a spinner with different coloritems.You set the Color with :

v.setBackgroundColor(YOURSELECTEDCOLOR );

with a listener like this you can set your color:

public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {

  Spinner temp = (Spinner) parent;
  switch(temp.getId()){
       case 1:
       YOOURSELECTEDCOLOR="GREEN";
       break;
       case 2:
       YOOURSELECTEDCOLOR="BLUE";
       break;
       ...  
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜