多次点击android版本出现棒棒糖,android – 为前棒棒糖设备创建循环显示
首先,這是與
Create circular reveal for pre-Lollipop devices (Android)不同的問題
我正在使用那里提到的庫來創建Circular Reveal,但它似乎對我不起作用.
XML
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id/circBack"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ff4081"
android:visibility="invisible"
>
JAVA
View myView = findViewById(R.id.circBack);
// get the center for the clipping circle
int cx = (myView.getLeft() + myView.getRight()) / 2;
int cy = (myView.getTop() + myView.getBottom()) / 2;
// get the final radius for the clipping circle
int finalRadius = Math.max(myView.getWidth(), myView.getHeight());
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius);
animator.setInterpolator(new AccelerateDecelerateInterpolator());
animator.setDuration(1000);
myView.setVisibility(View.VISIBLE);
animator.start();
圓形揭示沒有顯示出來.我的意思是代碼執行時沒有任何反應.
Logcat顯示了這一點
07-01 19:15:47.498 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class
07-01 19:15:47.498 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class
07-01 19:15:47.498 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class
07-01 19:15:47.501 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class
07-01 19:15:47.501 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class
07-01 19:15:47.502 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class
07-01 19:15:47.502 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class
07-01 19:15:47.502 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class
07-01 19:15:47.503 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class
07-01 19:15:47.503 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class
07-01 19:15:47.503 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class
但是,如果將視圖設置為在XML文件中可見,則圓形顯示確實有效,但問題是如果我將視圖“circBack”設置為在XML中可見,它從應用程序啟動時開始顯示,這通常是.
任何解決這個問題的方法?
總結
以上是生活随笔為你收集整理的多次点击android版本出现棒棒糖,android – 为前棒棒糖设备创建循环显示的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 微信墙服务器地址,一面微信墙的诞生(3)
- 下一篇: linux野指针追踪,【华清远见】野指针