1,佈局過於複雜:xml佈局文件可能存在深層嵌套或者組件過多;
2,重複繪製:一個界面的某一點可能在同一時間進行了多次繪製;
3,內存抖動:系統內存是有限的,系統經常會將不活躍的進程置入外存中就是常說的虛擬內存,當調用它時再把它從外存轉入內存,內存外存轉換頻率過大就會導致內存抖動;
4,性能瓶頸: 任務過多且執行調度不夠好;
5,歷史問原因,老代碼以及設計問題;
6,團隊人衆多員 ,存在過多的代碼合併和插入問題;
7,個別程序員的渣代碼
卡頓優化解決方案:
1,減低佈局的複雜度;
2,單線程任務不要太多;
3,適當調度;
4,將一些計算分擔給服務器端
去標題
getSupportActionBar().hide();
去狀態欄
getWindow()
.setFlags(WindowManager.LayoutParams
.FLAG_FULLSCREEN, WindowManager.LayoutParams
.FLAG_FULLSCREEN);
沉浸式
//透明狀態欄
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
//透明導航欄
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
android:fitsSystemWindows="true"
android:clipToPadding="true"
//其他
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
//透明狀態欄 getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
//透明導航欄 getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
SystemBarTintManager tintManager = new SystemBarTintManager(this);
// 激活狀態欄 tintManager.setStatusBarTintEnabled(true);
// enable navigation bar tint 激活導航欄 tintManager.setNavigationBarTintEnabled(true);
//設置系統欄設置顏色
//tintManager.setTintColor(R.color.red);
//給狀態欄設置顏色
tintManager.setStatusBarTintResource(R.color.mask_tags_1);
//Apply the specified drawable or color resource to the system navigation bar.
//給導航欄設置資源 tintManager.setNavigationBarTintResource(R.color.mask_tags_1); }
jar包
compile'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile'org.xutils:xutils:3.5.0'https://github.com/wyouflf/xUtils3
3.
http://www.cnblogs.com/JohnTsai/p/4715454.html
compile 'com.android.support:design:22.2.0' 後面的22.2.0要和v7包的版本一致
-- TableLayout
4.
http://blog.csdn.net/lmj623565791/article/details/36677279
http://blog.csdn.net/lmj623565791/article/details/36677279 SlidingMenu側滑菜單
5
網絡判斷跳轉到網絡界面
http://blog.csdn.net/wangjia55/article/details/7924664
我的文檔
http://note.youdao.com/noteshare?id=8f6eb09c2d2a8cf43f4c833f09731a14
studio設置自動導包:
http://blog.csdn.net/buaaroid/article/details/44979629