微信截圖_20201128183439.png
哥們點個贊再走呀
制作不容易,條件允許情況下绿满,打賞一下臂外,謝謝
項目build.gradle
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
加入作者的依賴,其中用戶名就是作者的微信
implementation 'com.github.nihaoxj123:rCode:1.1.5'
使用方法
<com.rCode.view.PopScreenView
android:id="@+id/pop"
app:speed="25" 默認(rèn)是35 如果覺得慢喇颁,往下調(diào)
android:layout_width="match_parent" 不建議使用wrap_content屬性漏健,要么給指定值,要么給match_parent屬性
android:layout_height="105dp"/> 不建議使用wrap_content屬性橘霎,要么給指定值蔫浆,要么給match_parent屬性
public class MainActivity extends AppCompatActivity {
private PopScreenView pop;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
pop = findViewById(R.id.pop);
}
int i = 0;
public void send(View view){
i++;
String arr[] = {"電話分機電話房價跌幅","大家趕緊","的飛機的攻擊大家趕快的給多個打卡滾動給"};
TextView tv = new TextView(this);
tv.setText(arr[i%arr.length]+i);
pop.addView(tv);
pop.start();
}
}