android屏幕全屏的實現(xiàn)代碼
更新時間:2013年05月27日 11:14:45 作者:
android屏幕全屏的實現(xiàn)代碼,需要的朋友可以參考一下
去掉標題欄:
requestWindowFeature(Window.FEATURE_NO_TITLE);
API上是這么說的:
int FEATURE_NO_TITLE Flag for the "no title" feature, turning off the title at the top of the screen.
屏幕全屏:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
API上是這么說的:
int FLAG_FULLSCREEN Window flag: Hide all screen decorations (e.g.
屏幕沒有邊界限制(允許窗口擴展到屏幕外):
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
API上是這么說的:
int FLAG_LAYOUT_NO_LIMITS Window flag: allow window to extend outside of the screen.
用法:
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
setContentView(R.layout.newslists);
newsListLayout = findViewById(R.id.newslistlayout);
newsListLayout.setBackgroundColor(Color.MAGENTA);
newsNameList = (ListView) findViewById(R.id.newsnamelist);
model = new Model(0, 6);
nameListAdapter = new NewsNameListAdapter(this, model);
newsNameList.setAdapter(nameListAdapter);
showPage = (TextView) findViewById(R.id.newslistshowpage);
updatePage(model.getIndex());
}
requestWindowFeature(Window.FEATURE_NO_TITLE);
API上是這么說的:
int FEATURE_NO_TITLE Flag for the "no title" feature, turning off the title at the top of the screen.
屏幕全屏:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
API上是這么說的:
int FLAG_FULLSCREEN Window flag: Hide all screen decorations (e.g.
屏幕沒有邊界限制(允許窗口擴展到屏幕外):
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
API上是這么說的:
int FLAG_LAYOUT_NO_LIMITS Window flag: allow window to extend outside of the screen.
用法:
復制代碼 代碼如下:
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
setContentView(R.layout.newslists);
newsListLayout = findViewById(R.id.newslistlayout);
newsListLayout.setBackgroundColor(Color.MAGENTA);
newsNameList = (ListView) findViewById(R.id.newsnamelist);
model = new Model(0, 6);
nameListAdapter = new NewsNameListAdapter(this, model);
newsNameList.setAdapter(nameListAdapter);
showPage = (TextView) findViewById(R.id.newslistshowpage);
updatePage(model.getIndex());
}
您可能感興趣的文章:
- Android調(diào)用默認瀏覽器打開指定Url的方法實例
- android webview 簡單瀏覽器實現(xiàn)代碼
- android 瀏覽器之多窗口方案詳解
- Android調(diào)用系統(tǒng)默認瀏覽器訪問的方法
- Android自定義 WebView瀏覽器
- android全屏去掉title欄的多種實現(xiàn)方法
- Android 設置應用全屏的兩種解決方法
- android activity設置無標題實現(xiàn)全屏
- android 設置全屏的兩種方法
- Android下Activity全屏顯示實現(xiàn)方法
- Android 全屏無標題欄的三種實現(xiàn)方法
- Android開發(fā)實現(xiàn)瀏覽器全屏顯示功能
相關(guān)文章
Android 中Fragment與Activity通訊的詳解
這篇文章主要介紹了Android 中Fragment與Activity通訊的詳解的相關(guān)資料,希望通過本文能幫助到大家,讓大家理解掌握如何通信的,需要的朋友可以參考下2017-10-10Android Caused by: java.lang.ClassNotFoundException解決辦法
這篇文章主要介紹了Android Caused by: java.lang.ClassNotFoundException解決辦法的相關(guān)資料,需要的朋友可以參考下2017-03-03Android實現(xiàn)網(wǎng)易Tab分類排序控件實現(xiàn)
這篇文章主要為大家詳細介紹了Android仿網(wǎng)易Tab分類排序控件的實現(xiàn)代碼,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-03-03Android自定義View實現(xiàn)隨機數(shù)驗證碼
這篇文章主要為大家詳細介紹了Android如何利用自定義View實現(xiàn)隨機數(shù)驗證碼效果,文中的示例代碼講解詳細,感興趣的小伙伴可以了解一下2022-06-06