一些關於Activity的技巧

2021-08-25 00:27:06 字數 794 閱讀 2836

[b]鎖定 activity 執行時的螢幕方向[/b]

[b]全屏的 activity[/b]

要使乙個 activity 全屏執行,可以在其 oncreate()方法中新增如下**實現:

// 設定全屏模式

getwindow().setflags(windowmanager.layoutparams.flag_fullscreen,

windowmanager.layoutparams.flag_fullscreen);

// 去除標題欄

requestwindowfeature(window.feature_no_title);

[b]在 activity 的 title 中加入進度條[/b]

在 activity 的標題欄中顯示進度條不失為乙個好辦法,下面是實現**:

// 不明確進度條

requestwindowfeature(window.feature_indeterminate_progress);

setcontentview(r.layout.main);

setprogressbarindeterminatevisibility(true);

// 明確進度條

requestwindowfeature(window.feature_progress);

setcontentview(r.layout.main);

setprogress(5000);

關於一些Code Blocks的使用技巧

進入code blocks官網,download release發行版 改變縮排大小 setings editor general setings font 中 將tab size in space增大到8。自動補全 框架 setings editor abbreviation,裡面定義了許多縮寫,...

關於使用fastadmin的一些技巧

關於使用fastadmin的一些技巧 1.在對應js中使用後端的資料 後端 this assignconfig 變數名 變數值 前端 config.變數名 例如 this assignconfig title 標題 config.title 2.在原有的初始化 基礎上傳自己想傳的引數 table.b...

關於陣列計算的一些技巧

本文 chengmo centos5 a 1 2 3 4 5 chengmo centos5 echo a 1一對括號表示是陣列,陣列元素用 空格 符號分割開。2.陣列讀取與賦值 chengmo centos5 echo 5用 可以得到陣列長度 chengmo centos5 echo 3 chen...