12 2020 档案
摘要:在做的项目有太多动画 一天下来手机就很卡 优化方案: 先看我之前写的代码: ObjectAnimator animator = ObjectAnimator.ofFloat(innerView, "translationY", 0f, 30f, 0f); animator.setDuration(4
阅读全文
摘要:1.卡顿 丢帧 android不如ios流畅 因为在ios中ui渲染具有优先等级,而android不一样 需要优化几点: 编码中ui线程耗时操作尽量避免 布局尽量用最新的布局 有利于渲染 否则复杂布局无法在16ms内完成渲染 16ms是因为android运行流畅需要满足运行60帧/s 每帧的处理时间
阅读全文
摘要:tv1.setMovementMethod(ScrollingMovementMethod.getInstance()); tv1.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(Vie
阅读全文
摘要:如图:打印日志 E/HsmCoreServiceImpl: onTransact in code is: 103 2020-12-19 22:23:29.078 629-13102/? E/uniperf server: uniPerfEvent doParse failed, cmdId=4400
阅读全文
摘要:******* if(mode == REPEAT1) { if(!mPlayer.isLooping()) { mPlayer.setLooping(true); //打开app当前无音乐播放时,setLooping会无作用,先记录在播放时重新setLooping if(!mPlayer.isLo
阅读全文
摘要:Android TextView <TextView android:id="@+id/tv_name" android:layout_width="wrap_content" android:layout_height="wrap_content" /> 设置显示文本单行显示 android:si
阅读全文
摘要:welcome.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://sche
阅读全文
摘要:// ImmersionBar.with(this) // .hideBar(BarHide.FLAG_HIDE_NAVIGATION_BAR) // .init();
阅读全文
摘要:第一种:自己编写进出效果 然后给activity加上就ok了 例如:(首先要在res文件夹下建立anim文件夹,然后把动画效果xml文件放到里面去) 1.放大进入, zoomin.xml: <?xml version="1.0" encoding="utf-8"?> <set xmlns:andro
阅读全文
摘要:Drawable drawable = 你的ImageView.getDrawable(); Bitmap bitmap = null; if (null!=drawable) { bitmap = ((BitmapDrawable)drawable).getBitmap(); } if (null
阅读全文