刚开始内层LinearLayout直接用

android:layout_height="match_parent"
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/black"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="64dp"> <LinearLayout
android:id="@+id/layout_home"
android:gravity="center"
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"> <ImageView
android:id="@+id/btn_home"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@mipmap/ic_notification_bar_home"/> <TextView
android:id="@+id/tv_home"
android:textColor="@color/white"
android:text="@string/noti_home"
android:textSize="@dimen/sp_12"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout> <ImageView
android:background="#ffffff"
android:alpha="0.2"
android:layout_width="@dimen/dp_0_5"
android:layout_height="@dimen/dp_28"/> <LinearLayout
android:id="@+id/layout_junk"
android:gravity="center"
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"> <ImageView
android:id="@+id/btn_junk"
android:layout_width="24dp"
android:layout_height="24dp"
android:background="@mipmap/ic_notification_bar_junk"/> <TextView
android:id="@+id/tv_junk"
android:text="@string/noti_junk"
android:textSize="@dimen/sp_12"
android:textColor="@color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> </LinearLayout> <ImageView
android:background="#ffffff"
android:alpha="0.2"
android:layout_width="@dimen/dp_0_5"
android:layout_height="@dimen/dp_28"/> <LinearLayout
android:id="@+id/layout_boost"
android:gravity="center"
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"> <ImageView
android:id="@+id/img_boost"
android:layout_width="24dp"
android:layout_height="24dp" /> <TextView
android:id="@+id/tv_boost"
android:textColor="@color/white"
android:text="@string/noti_boost"
android:textSize="@dimen/sp_12"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout> <ImageView
android:background="#ffffff"
android:alpha="0.2"
android:layout_width="@dimen/dp_0_5"
android:layout_height="@dimen/dp_28"/> <LinearLayout
android:id="@+id/layout_cpu"
android:gravity="center"
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"> <FrameLayout
android:layout_width="24dp"
android:layout_height="24dp"> <ImageView
android:id="@+id/btn_cpu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_notification_bar_cpu"/> <ImageView
android:id="@+id/cpu_warn_icon"
android:visibility="invisible"
android:src="@mipmap/img_cpu_warn"
android:layout_gravity="bottom|right"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> </FrameLayout> <TextView
android:id="@+id/tv_cpu"
android:textColor="@color/white"
android:text="@string/noti_cpu"
android:textSize="@dimen/sp_12"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout> </LinearLayout>

后来改成这样:

内层LinearLayout设置为:android:layout_height="64dp"

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/black"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="64dp"> <LinearLayout
android:id="@+id/layout_home"
android:gravity="center"
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="64dp"> <ImageView
android:id="@+id/btn_home"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@mipmap/ic_notification_bar_home"/> <TextView
android:id="@+id/tv_home"
android:textColor="@color/white"
android:text="@string/noti_home"
android:textSize="@dimen/sp_12"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout> <ImageView
android:background="#ffffff"
android:alpha="0.2"
android:layout_width="@dimen/dp_0_5"
android:layout_height="@dimen/dp_28"/> <LinearLayout
android:id="@+id/layout_junk"
android:gravity="center"
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"> <ImageView
android:id="@+id/btn_junk"
android:layout_width="24dp"
android:layout_height="24dp"
android:background="@mipmap/ic_notification_bar_junk"/> <TextView
android:id="@+id/tv_junk"
android:text="@string/noti_junk"
android:textSize="@dimen/sp_12"
android:textColor="@color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> </LinearLayout> <ImageView
android:background="#ffffff"
android:alpha="0.2"
android:layout_width="@dimen/dp_0_5"
android:layout_height="@dimen/dp_28"/> <LinearLayout
android:id="@+id/layout_boost"
android:gravity="center"
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"> <ImageView
android:id="@+id/img_boost"
android:layout_width="24dp"
android:layout_height="24dp" /> <TextView
android:id="@+id/tv_boost"
android:textColor="@color/white"
android:text="@string/noti_boost"
android:textSize="@dimen/sp_12"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout> <ImageView
android:background="#ffffff"
android:alpha="0.2"
android:layout_width="@dimen/dp_0_5"
android:layout_height="@dimen/dp_28"/> <LinearLayout
android:id="@+id/layout_cpu"
android:gravity="center"
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"> <FrameLayout
android:layout_width="24dp"
android:layout_height="24dp"> <ImageView
android:id="@+id/btn_cpu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_notification_bar_cpu"/> <ImageView
android:id="@+id/cpu_warn_icon"
android:visibility="invisible"
android:src="@mipmap/img_cpu_warn"
android:layout_gravity="bottom|right"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> </FrameLayout> <TextView
android:id="@+id/tv_cpu"
android:textColor="@color/white"
android:text="@string/noti_cpu"
android:textSize="@dimen/sp_12"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout> </LinearLayout>

  就可以看到通知栏变高了

RemoteView设置高度的更多相关文章

  1. 如何给span设置高度宽度?

    内容提要:给Span设置高度和宽度后没有作用.本文介绍了如何如何给span设置高度宽度. CSS模型中经常用的容器是DIV和span. 给Span设置高度和宽度后没有作用. <style typ ...

  2. div+css总结—FF下div不设置高度背景颜色或外边框不能正常显示的解决方法(借鉴)

    原地址:http://blog.sina.com.cn/s/blog_60b35e830100qwr2.html 在使用div+css进行网页布局时,如果外部div有背景颜色或者边框,而不设置其高度, ...

  3. 对Iframe和图表设置高度的优质代码

    //对Iframe和图表设置高度 function f() { parent.window.setWinHeight(parent.window.document.getElementById(&qu ...

  4. Chrome&FF&Opera&下DIV不设置高度显示背景颜色和边框的办法

    今天在排版的时候,外层的div不写高度的话背景颜色和边框没法办法显示,但是在IE下面就可以,这个有三个解决办法. 第一: 直接给最外层的div设置高度(不推荐). 第二: 在内部每个div后添加一个清 ...

  5. pickView不需要明确设置高度

    pickView不用设置高度,若设置了,在iOS8.4.1上不会被填充,会造成没有把pickView高度设置成你想要的,但是布局其他地方的时候却会从你设置的地方开始,就会造成布局不紧挨着或者遮盖着的效 ...

  6. HTML的TextArea标记跟随文本内容自动设置高度

    js <textarea name="textarea" id="textarea" style='overflow-y: hidden;height:2 ...

  7. 关于ckeditor5设置高度

    在管理端模板AdminBSBMaterialDesign-master里发现一个比百度编辑器看起来更高大上的编辑器:ckeditor.模板中使用的是版本4,自己在官网上下载了最新版本.在之前的版本,使 ...

  8. ueditor 设置高度height. ue.setHeight(400); 设置宽度 width

    1.引入的文件: <script type="text/javascript" src="../../dist/ueditor1_4_3-utf8-php/uedi ...

  9. 控件View动态设置高度时会卡顿、速度慢的情况解决

    今天碰到这种情况,一直想不通是什么问题,之前一直设置高度的时候也不卡为何今天就这么卡了.做了很多小示例一直是很慢,后来试着把View的上级节点RelativeLayout的替换成了LinearLayo ...

随机推荐

  1. 【新特性速递】F.doPostBack的说明文档

    FineUIPro/Mvc/Core的下个版本(v6.1.0),我们对客户端JS函数 F.doPostBack 进行了增强,并增加说明文档. 如果你还没有查阅过FineUI的客户端文档,可以收藏下这个 ...

  2. RemoteViews 整理

    前言 RemoteViews表面意思就是远程的view,这个就很难理解了,远程的view.但是英语是抽象,remote本身就是偏僻的,偏远的意思. 所以remoteViews 就是地方view,天高皇 ...

  3. js -- 时间转年月日

    /** * 时间转年月日 * @param sdate 开始的时间 * @param edate 结束的时间 * @returns {*} */ function day2ymrStr2(sdate, ...

  4. Java+Selenium+Testng自动化测试学习(四)— 报告

    自动化测试报告,在测试用例完成之后系统自动生成HTML报告 使用testng中的报告模板生成报告, 1.在TestSuit.xml文件中配置报告监听 2.运行xml文件 3.自动生成一个test-ou ...

  5. python接口自动化之用HTMLTestRunner生成html测试报告

    [第一步]:引入HTMLTestRunner包 1.下载HTMLTestRunner,下载地址:http://tungwaiyip.info/software/HTMLTestRunner.html ...

  6. logits的用法和此类标注的作用,已经再最后一层加了映射了就不需要再加入了

    logits的用法和此类标注的作用,已经再最后一层加了映射了就不需要再加入了 待办 PyTorch(tensorflow类似)的损失函数中,有一个(类)损失函数名字中带了with_logits. 而这 ...

  7. html中实现数据的显示和隐藏

    Author: YangQingQing <!DOCTYPE html><html><meta http-equiv="Content-Type" c ...

  8. GoAhead WebServer 架构

    https://blog.csdn.net/jungsagacity/article/details/7307012

  9. 牛客网刷题总结—Day1

    1.关于哈夫曼树 哈夫曼树也称最优二叉树,其n个叶子节点都是带有权值的,其节点的带权路径长度(n个叶子节点的权值*其到根节点的路径之和)最小的二叉树即为哈夫曼树. 一般的哈夫曼树不存在度为1的节点(除 ...

  10. ONESHELL

    没有加 .ONESHELL 的时候,片段中的各行 shell 彼此独立. 加了 .ONESHELL 后,各行shell 可以看作一行 shell. <1> .PHONY: all all: ...