RemoteView设置高度
刚开始内层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设置高度的更多相关文章
- 如何给span设置高度宽度?
内容提要:给Span设置高度和宽度后没有作用.本文介绍了如何如何给span设置高度宽度. CSS模型中经常用的容器是DIV和span. 给Span设置高度和宽度后没有作用. <style typ ...
- div+css总结—FF下div不设置高度背景颜色或外边框不能正常显示的解决方法(借鉴)
原地址:http://blog.sina.com.cn/s/blog_60b35e830100qwr2.html 在使用div+css进行网页布局时,如果外部div有背景颜色或者边框,而不设置其高度, ...
- 对Iframe和图表设置高度的优质代码
//对Iframe和图表设置高度 function f() { parent.window.setWinHeight(parent.window.document.getElementById(&qu ...
- Chrome&FF&Opera&下DIV不设置高度显示背景颜色和边框的办法
今天在排版的时候,外层的div不写高度的话背景颜色和边框没法办法显示,但是在IE下面就可以,这个有三个解决办法. 第一: 直接给最外层的div设置高度(不推荐). 第二: 在内部每个div后添加一个清 ...
- pickView不需要明确设置高度
pickView不用设置高度,若设置了,在iOS8.4.1上不会被填充,会造成没有把pickView高度设置成你想要的,但是布局其他地方的时候却会从你设置的地方开始,就会造成布局不紧挨着或者遮盖着的效 ...
- HTML的TextArea标记跟随文本内容自动设置高度
js <textarea name="textarea" id="textarea" style='overflow-y: hidden;height:2 ...
- 关于ckeditor5设置高度
在管理端模板AdminBSBMaterialDesign-master里发现一个比百度编辑器看起来更高大上的编辑器:ckeditor.模板中使用的是版本4,自己在官网上下载了最新版本.在之前的版本,使 ...
- ueditor 设置高度height. ue.setHeight(400); 设置宽度 width
1.引入的文件: <script type="text/javascript" src="../../dist/ueditor1_4_3-utf8-php/uedi ...
- 控件View动态设置高度时会卡顿、速度慢的情况解决
今天碰到这种情况,一直想不通是什么问题,之前一直设置高度的时候也不卡为何今天就这么卡了.做了很多小示例一直是很慢,后来试着把View的上级节点RelativeLayout的替换成了LinearLayo ...
随机推荐
- java基础之 控制语句
java基础之控制语句 在java中控制语句包括: if-else语句 swicth-case 语句 while循环 do-while循环 for循环 break语句 continue语句 其中:if ...
- 第三十七篇 入门机器学习——Numpy基础
No.1. 查看numpy版本 No.2. 为了方便使用numpy,在导入时顺便起个别名 No.3. numpy.array的基本操作:创建.查询.修改 No.4. 用dtype查看当前元素的数据类型 ...
- 命令行(二):Anaconda3
1,进入base虚拟环境 $:activate 2,创建虚拟环境(自动下载Python3最新版本) $:conda create -n <virtual_name> python= 3,切 ...
- bootstrap联动校验(转载)
接触bootstrapvalidator时间不久,最近需要多个字段共同验证,网上查了一下未找到,查阅api文档,发现确实可以实现. 先看dom <div class="form-gro ...
- LED Decorative Light Manufacturer - LED Neon Rope: 5 Advantages
In the past 100 years, lighting has come a long way. Nowadays, the decorative LED lighting design ca ...
- 每天进步一点点------Xilinx FPGA开发工具 EDK SDK术语
XPS:Xilinx Platform Studio,平台工作室.用于嵌入式处理器硬件部分的开发. SDK:Software Development Kit,软件开发套件.基于Eclipse平台,支持 ...
- 【转载】Java的JDBC事务详解
转自:http://www.cnblogs.com/azhqiang/p/4044127.html 事务的特性: 1) 原子性(atomicity):事务是数据库的逻辑工作单位,而且是必须是原子工作单 ...
- Object的rest和spread方法
//将多个对象合并到一个对象里 const input = { a: 1, b: 2 } const test = { d: 5 } const output = { ...input, ...tes ...
- js加密(三)企名片
1. url: https://www.qimingpian.cn/finosda/project/pinvestment 2. target: 3. 简单分析 3.1 打开调试窗口,刷新页面,看看都 ...
- 安装Redis教程
今天因为要用到redis中间件,于是自己就尝试安装一下,我把步骤记录了,分享给大家,希望能对大家有帮助! 我的博客地址: https://www.cnblogs.com/themysteryofhac ...