Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/180.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在应用程序页面中实现飘雪效果?_Android_2d - Fatal编程技术网

Android 如何在应用程序页面中实现飘雪效果?

Android 如何在应用程序页面中实现飘雪效果?,android,2d,Android,2d,如何在已完成的活动中添加浮雪效果 我使用画布和2D制作浮雪效果。但我在主页中使用main.xml。我用 http://ask.csdn.net/questions/1246 但我在网上查代码是 PetalView pv = new PetalView(this); setContentView(pv); 如何将这两个视图混合在一起 如何在顶部产生效果并且不影响此活动页面的操作?从框架布局开始(它允许您堆叠视图): 添加您的xml: LayoutInflater inflater =

如何在已完成的活动中添加浮雪效果

我使用画布和2D制作浮雪效果。但我在主页中使用main.xml。我用

http://ask.csdn.net/questions/1246
但我在网上查代码是

PetalView pv = new PetalView(this);
setContentView(pv);
如何将这两个视图混合在一起


如何在顶部产生效果并且不影响此活动页面的操作?

框架布局开始(它允许您堆叠视图):

添加您的xml:

    LayoutInflater inflater = LayoutInflater.from(this);
    View mainView = inflater.inflate(R.layout.main, null);
    fl.addView(mainView);
添加具有透明背景的动态视图:

    PetalView pv = new PetalView(this);
    pv.setBackgroundColor(0x00000000);
    fl.addView(pv);

    setContentView(fl);        

从一个
框架布局开始(它允许您堆叠视图):

添加您的xml:

    LayoutInflater inflater = LayoutInflater.from(this);
    View mainView = inflater.inflate(R.layout.main, null);
    fl.addView(mainView);
添加具有透明背景的动态视图:

    PetalView pv = new PetalView(this);
    pv.setBackgroundColor(0x00000000);
    fl.addView(pv);

    setContentView(fl);