android屏幕全屏的實(shí)現(xiàn)代碼
更新時間:2013年05月27日 11:14:45 作者:
android屏幕全屏的實(shí)現(xiàn)代碼,需要的朋友可以參考一下
去掉標(biāo)題欄:
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.
屏幕沒有邊界限制(允許窗口擴(kuò)展到屏幕外):
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.
屏幕沒有邊界限制(允許窗口擴(kuò)展到屏幕外):
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
API上是這么說的:
int FLAG_LAYOUT_NO_LIMITS Window flag: allow window to extend outside of the screen.
用法:
復(fù)制代碼 代碼如下:
@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)用默認(rèn)瀏覽器打開指定Url的方法實(shí)例
- android webview 簡單瀏覽器實(shí)現(xiàn)代碼
- android 瀏覽器之多窗口方案詳解
- Android調(diào)用系統(tǒng)默認(rèn)瀏覽器訪問的方法
- Android自定義 WebView瀏覽器
- android全屏去掉title欄的多種實(shí)現(xiàn)方法
- Android 設(shè)置應(yīng)用全屏的兩種解決方法
- android activity設(shè)置無標(biāo)題實(shí)現(xiàn)全屏
- android 設(shè)置全屏的兩種方法
- Android下Activity全屏顯示實(shí)現(xiàn)方法
- Android 全屏無標(biāo)題欄的三種實(shí)現(xiàn)方法
- Android開發(fā)實(shí)現(xiàn)瀏覽器全屏顯示功能
相關(guān)文章
Android有效獲取狀態(tài)欄(StatusBar)高度的方法
這篇文章主要介紹了Android有效獲取狀態(tài)欄(StatusBar)高度的方法,涉及Android針對狀態(tài)欄(StatusBar)屬性操作的相關(guān)技巧,需要的朋友可以參考下2016-08-08
Android中的深度鏈接技術(shù)實(shí)戰(zhàn)
本文主要介紹了Android中的深度鏈接技術(shù)實(shí)戰(zhàn),文中通過示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下2022-03-03
詳解Android中Intent傳遞對象給Activity的方法
這篇文章主要介紹了Android中Intent傳遞對象給Activity的方法,文章中對Activity的生命周期等知識先作了簡要的介紹,需要的朋友可以參考下2016-04-04
一個強(qiáng)大的側(cè)滑菜單控件ASwipeLayout
這篇文章主要為大家詳細(xì)介紹了強(qiáng)大的側(cè)滑菜單控件ASwipeLayout使用方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下2018-08-08
Android利用SurfaceView實(shí)現(xiàn)下雨的天氣動畫效果
這篇文章主要介紹了Android利用SurfaceView實(shí)現(xiàn)下雨天氣效果的相關(guān)資料,文中詳細(xì)介紹 SurfaceView 和 View 的區(qū)別,以及一些需要使用到 SurfaceView 的場景。需要的朋友可以參考借鑒,下面來一起看看吧。2017-03-03
淺談Service Manager成為Android進(jìn)程間通信(IPC)機(jī)制Binder守護(hù)進(jìn)程之路
本文主要介紹 淺談Service Manager成為Android進(jìn)程間通信(IPC)機(jī)制Binder守護(hù)進(jìn)程之路,這里詳細(xì)介紹了相關(guān)Binder的資料,幫助大家理解學(xué)習(xí)Android 源碼Binder通信機(jī)制,有興趣的小伙伴可以參考下2016-08-08
android高仿小米時鐘(使用Camera和Matrix實(shí)現(xiàn)3D效果)
這篇文章主要介紹了android高仿小米時鐘(使用Camera和Matrix實(shí)現(xiàn)3D效果),非常具有實(shí)用價值,需要的朋友可以參考下。2017-01-01

