首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

Android 动态切换全屏跟非全屏模式

2012-07-19 
Android 动态切换全屏和非全屏模式直接贴出代码:?else?{??????????????????????button.setText(getResourc

Android 动态切换全屏和非全屏模式

直接贴出代码:

?

    else?{??
  1. ????????????????????button.setText(getResources().getText(R.string.full_screen));??
  2. ????????????????????WindowManager.LayoutParams?params?=?getWindow().getAttributes();??
  3. ????????????????????params.flags?&=?(~WindowManager.LayoutParams.FLAG_FULLSCREEN);??
  4. ????????????????????getWindow().setAttributes(params);??
  5. ????????????????????getWindow().clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);??
  6. ????????????????}??
  7. ????????????}??
  8. ????????});??
  9. ??????????
  10. ????}??
  11. }??

?

热点排行