Android沉浸式任务栏的实现
1、MainActivity.java
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//透明状态栏
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
//透明导航栏
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
}
}
2、布局文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:orientation="vertical"
tools:context=".MainActivity"> <TextView
android:fitsSystemWindows="true"
android:clipToPadding="true"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#282525" /> <LinearLayout
android:background="#282525"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"> <LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent" android:orientation="vertical"> <TextView
android:id="@+id/telepone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="48dp"
android:text="1310069**** | 官方"
android:textColor="#FFFFFF"
android:textSize="28dp" /> <TextView
android:textSize="18dp"
android:id="@+id/location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="湖北省武汉市"
android:textColor="#FFFFFF" /> <TextView
android:textSize="18dp"
android:id="@+id/phpnestate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="正在拨通"
android:textColor="#FFFFFF" /> <GridLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"></GridLayout>
</LinearLayout>
</LinearLayout> </LinearLayout>

Android沉浸式任务栏的实现的更多相关文章
- android -------- 沉浸式状态栏和沉浸式导航栏(ImmersionBar)
android 4.4以上沉浸式状态栏和沉浸式导航栏管理,包括状态栏字体颜色,适用于Activity.Fragment.DialogFragment.Dialog,并且适配刘海屏,适配软键盘弹出等问题 ...
- [置顶]
Xamarin android沉浸式状态栏
虽然关于android "沉浸式"状态栏有很多博客介绍过,从小菜到大神无一例外.我第一次看到这种"沉浸"式的效果我也以为真的是这么叫,然而根本不是这么回事,完全 ...
- Android 沉浸式状态栏攻略 让你的状态栏变色吧
转载请标明出处: http://blog.csdn.net/lmj623565791/article/details/48649563: 本文出自:[张鸿洋的博客] 一.概述 近期注意到QQ新版使用了 ...
- Android 沉浸式状态栏完美解决方案
现在搜索Android 沉浸式状态栏,真的是一堆一堆,写的特别多,但是真正用的舒服的真没有,在这里自己整理一下开发记录 注意,在使用这个步骤过程之前,请把之前设置的代码注释一下 把布局带有androi ...
- Android沉浸式状态栏兼容4.4手机的实现
一.概述 最近注意到QQ新版使用了沉浸式状态栏,ok.先声明一下:本篇博客效果下图: 关于这个状态栏变色究竟叫「Immersive Mode」/「Translucent Bars」有兴趣能够去 为什么 ...
- 【Android实战】Android沉浸式状态栏实现(下)
之前的Android沉浸式状态栏实现并没有考虑软键盘的影响,接下来的内容将会针对这个问题给出解决方式,先看一下效果图 这个是一个留言板的效果图: 即弹出软键盘的时候并不会导致整个布局上移. 详细怎样实 ...
- Android 沉浸式状态栏 实现方式二 ( 更简单 )
以前写过一个沉浸式状态栏 的实现方式 Android 沉浸式状态栏 实现方式一 现在有个更为简单的实现方式 . 相关链接 http://www.apkbus.com/forum.php?mod=vie ...
- Android沉浸式(侵入式)标题栏(状态栏)Status(三)
Android沉浸式(侵入式)标题栏(状态栏)Status(三) 从附录文章1,2可以看到,依靠Android系统提供的标准方案,状态栏即便在透明状态下,仍然有些半透明而不是全透明.本文是And ...
- Android沉浸式(侵入式)标题栏(状态栏)Status(二)
Android沉浸式(侵入式)标题栏(状态栏)Status(二) 附录1以xml写style实现了Android沉浸式(侵入式)状态栏(标题栏),同样以上层Java代码实现.在附录文章1的基础上 ...
随机推荐
- Lambda表达式 和 Expression<T>
经常用的Lambda表达式 返回的是 Expression<T> 格式 public class ActivityService { private readonly List<A ...
- WinForm------TreeList实现鼠标经过节点背景色改变
转载: http://www.cnblogs.com/zfanlong1314/archive/2012/06/26/2564124.html
- mysql_query()与mysql_real_query()
mysql_query() cannot be used ” character, which mysql_query() interprets as the end of the statement ...
- squid代理服务器配置详解
root@proxy squid]# cat squid.conf## Recommended minimum configuration:#visible_hostname www.jd.com # ...
- centos6.5分区简易操作
fdisk /dev/sdb --->n--->p---->输入分区大小(回车就默认全部大小) mkfs.ext4 /dev/sdb1 mkdir /data 在根目录下新建data ...
- linux远程登录(Telnet、SSH)
系统:RHEL 5.5 64位,使用CentOS的yum源并作更新处理 参考书目<Linux兵书>/电子工业出版社/刘丽霞,细节之处稍有变动. 一.Telnet(远程登录推荐SSH) 1. ...
- nginx配置文件详解( 看着好长,其实不长,看了就知道了,精心整理,有些配置也是没用到呢 )
user www www; #定义Nginx运行的用户和用户组 worker_processes ; #nginx进程数,建议设置为CPU核数2倍. error_log var/log/ ...
- URL中“#” “?” &“”号的作用
URL中"#" "?" &""号的作用 阅读目录 1. # 2. ? 3. & 回到顶部 1. # 10年9月,twit ...
- Java %c0%ae 安全模式绕过漏洞
漏洞类型:安全模式绕过漏洞 漏洞描述:在Java端"%c0%ae"解析为"\uC0AE",最后转义为ASCCII低字符-".".通过这个方法 ...
- MySQL中MAX函数与Group By一起使用的注意事项(转)
mysql> select * from test; +----+-------+------+-------+ | id | name | age | class | +----+------ ...