http://my.oschina.net/jerikc/blog/291815
1. 在Activity中的onCreate方法中加入如下代码:
//Remove title bar
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//Remove notification bar
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
//set content view AFTER ABOVE sequence (to avoid crash)
this.setContentView(R.layout.your_layout_name_here);
2.修改AndroidManifest.xml中的activity节点的theme属性
<activity android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
3.修改AndroidManifest.xml中的application节点的theme属性
分享到:
相关推荐
自Android 3.0开始,传统的菜单按钮被操作栏(Action Bar)取代,Android 5.0时更名为应用栏(App Bar)。菜单主要有四种类型:选项菜单、上下文菜单、上下文操作栏和弹出菜单。 1. 选项菜单(Options menu)是最...
在调用 `setCurrentView()` 之前,可以使用 `requestWindowFeature(Window.FEATURE_NO_TITLE)` 来隐藏标题栏,实现全屏效果。 - 同样,通过设置 `FLAG_FULLSCREEN` 标志,可以隐藏状态栏。首先获取窗口对象 `...
ActionBar左上角的图标通常作为返回主屏幕或向上导航的操作,可以通过`setDisplayHomeAsUpEnabled(true)`设置,并在`onOptionsItemSelected`中处理`android.R.id.home`的点击事件。 在应用ActionBar时,确保你的...
- **Split Action Bar**:为了应对屏幕旋转和不同分辨率,Android支持split action bar,将内容分散到不同bar中。这包括: - **Main action bar**:提供上一级导航,是必需的。 - **Top bar**:用于切换不同内容...
当 Action Bar 上的 Action 按钮无法全部显示时,系统会将它们放入 overflow 中。我们可以通过 `PopupWindow` 来模仿这一行为,实现自定义的 overflow 效果,以扩展应用的功能。 为了创建自定义 overflow,我们需要...
在Android应用开发中,顶部工具栏(通常称为Action Bar或者Toolbar)和底部工具栏(Bottom Navigation Bar)是常见的用户界面元素,它们提供了便捷的操作入口,增强了用户体验。下面将详细介绍这两种工具栏的实现...
-- Title Bar --> ... <!-- Input Amount Area --> ... <!-- Keyboard Layout --> android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="6" android:orientation=...
在Android 3.0(API级别11)及更高版本中,Action Bar取代了传统的Options Menu,但为了兼容低版本系统,可以使用`android:showAsAction`属性控制菜单项是否显示在Action Bar中。 总的来说,Android中的Menu提供了...
mTitleTextView = findViewById(R.id.action_bar_title_tv); mContentLayout = findViewById(R.id.layout_content); close_tv = findViewById(R.id.action_bar_close_tv); ImageView back_ic = findViewById(R...
首先,我们需要了解Android的状态栏是位于屏幕顶部,通常显示时间、网络信号、电池等系统信息。为了实现状态栏透明,我们需要针对不同的Android版本采用不同的处理方式,因为Android系统从KitKat(API 19)开始引入...
因此,如果你希望在菜单项中包含图标,你可能需要使用其他类型的菜单,如OptionsMenu,它通常在屏幕顶部的Action Bar中显示,但也可以在设备没有硬件菜单键时作为弹出菜单使用。 总的来说,实现类似PC右键菜单效果...
ndroid:id="@+id/ringtone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:id="@+id/ringtone_title" android:layout_...
在Android应用开发中,OptionsMenu是显示在屏幕顶部或者在动作栏(Action Bar)中的一个菜单,通常包含一些常用的操作选项。下面将详细介绍如何在Android中创建OptionsMenu,包括使用XML配置和直接通过代码创建两种...
`android:scrollbars="none"`是为了隐藏滚动条,保持界面整洁。`android:fadingEdge="vertical"`是设置垂直渐变边缘,增强滚动的平滑感。 3. **ImageView (column_slide_bar)**: 通常表示当前选中的栏目,通过改变...
在`top_layout.xml`文件中,使用了一个`RelativeLayout`作为容器,设置了背景为`title_bar`。在`RelativeLayout`内,我们有两个`ImageButton`,分别表示添加和搜索功能,它们位于屏幕的右端。`TextView`用于展示当前...
android:background="@drawable/title_bar_bg_one_row" zhy:tab_count="5" <!-- 自定义属性,设置Tab数量 --> zhy:visible_tab="3" <!-- 自定义属性,设置可见Tab数量 --> ... /> ``` 总的来说,实现仿MIUI的...
int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); if (resourceId > 0) { statusBarHeight = context.getResources().getDimensionPixelSize(resourceId); } ...
FadingActionBar 仿美团上拉背景渐变,默认背景透明,下拉bar完全隐藏 。开发者使用此依赖,只需要2个方法就可以实现美团外卖中上拉titlebar背景渐变,下拉titlebar隐藏效果。效果图:准备工作:1.注意actionbar的...
这个是固定在屏幕顶部的一个头部标题栏。如果给它加上’bar-subheader’ 这个样式,它就是副标题。 用法 Left Button Title! Right Button Some content! API 属性 类型 描述 align-title ...