寫這篇博客呢主要是來自1個(gè)需求吧,快到除夕了,每一個(gè)公司能年前都要上1個(gè)版本,年前的版本里面肯定會(huì)需要1些殊效,就比如今天的說的這個(gè)從上到下飄落雪花的殊效,我寫的是雪花的,至于你們想飄甚么你們來定嘍,建議大家在用代碼的同時(shí)看1看代碼,其實(shí)很簡(jiǎn)單。好的先看效果吧。
看到這個(gè)大家可能會(huì)感覺到難,那你就想多了,很簡(jiǎn)單,下面我就開始講授1下這個(gè)效果。
首先看主Activity的布局和代碼
R.layout.snowmainlayout
<?xml version="1.0" encoding="utf⑻"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="#000000"> <snowtwo.SnowView android:id="@+id/snow2" android:layout_width="match_parent" android:layout_height="match_parent"/> </LinearLayout>
MainActivity

看!是否是很簡(jiǎn)單,1行代碼弄定,有木有想打賞我感覺?好了,那就把干貨放到資源里面供大家使用吧,希望大家可以跟我交換。
大家如果感覺哪里不適合或有疑問可以留言,我會(huì)及時(shí)回復(fù)。
轉(zhuǎn)載請(qǐng)注明出處,謝謝!
上一篇 Java中的枚舉值