Android requestWindowFeature() 的目的是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12680055/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the purpose of requestWindowFeature()?
提问by DuyguK
回答by Victor Ronin
Each activity has an associated window (on which the whole UI draws). This window has default way of being drawn (whether toolbar, actionbar, icons are drawn or not).
每个活动都有一个关联的窗口(整个 UI 在其上绘制)。该窗口具有默认的绘制方式(无论是否绘制工具栏、操作栏、图标)。
However, you can use requestWindowFeature
to ask the system to include or exclude some of windows features (toolbar, actionbar and so on).
但是,您可以使用requestWindowFeature
要求系统包含或排除某些 Windows 功能(工具栏、操作栏等)。
Here you can find the full list of supported features: http://developer.android.com/reference/android/view/Window.html
在这里您可以找到支持功能的完整列表:http: //developer.android.com/reference/android/view/Window.html
As example, you can use FEATURE_NO_TITLE
to make a window full screen or FEATURE_RIGHT_ICON
to let system know that icon should be drawn on the right side.
例如,您可以使用FEATURE_NO_TITLE
全屏显示窗口或FEATURE_RIGHT_ICON
让系统知道应该在右侧绘制图标。