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 ...
随机推荐
- 【转】继承了母版页的子页面中触发body的onload事件
碰到有个继承了母版页的页面要加载body的onload事件,我发了一下午来解决这个问题,终于在国外某论坛上找到了解决方案 Method1: In the master page make the bo ...
- mybatis(六):设计模式 - 适配器模式
- KMP算法例题
链接:https://codeforces.com/contest/1200/problem/E 题意:依次合并两个单词,每次合并将删去最长相同前后缀,输出结果. 思路:用kmp跑出每个需要被连接的单 ...
- 图的最小生成树prim算法模板
用prim算法构建最小生成树适合顶点数据较少而边较多的图(稠密图) prim算法生成连通图的最小生成树模板伪代码: G为图,一般为全局变量,数组d为顶点与集合s的最短距离 Prim(G, d[]){ ...
- linux下grep分析apache日志的命令集合
https://my.oschina.net/hmc0316/blog/112004 实例:月份英文简写英文全称一月Jan.January二月Feb.February三月Mar.March四月Apr. ...
- 美化传奇NPC对话框添加图片显示实列
NPC对话框一般都是文字显示,有些GM想突出版本特色,在NPC对话框加些专业图片,彰显独特之处,其实这是很简单的.下面为你讲解美化传奇NPC对话框添加图片显示实列 我们要添加你要放入npc图片的补丁. ...
- 路飞-pip源
pip安装源 介绍 """ 1.采用国内源,加速下载模块的速度 2.常用pip源: -- 豆瓣:https://pypi.douban.com/simple -- 阿里: ...
- 概率dp 148 D
概率dp 设 f(i,j)f(i,j) 表示有 ii 只白鼠,jj 只黑鼠时A先手胜的概率 初始状态 全白时,显然先手必胜 有一只黑鼠时,先手若抽到黑鼠则后手必胜,所以先手首回合必须抽到白鼠 f(i, ...
- vue项目怎么搭建到云服务器上
链接1:https://blog.csdn.net/qq_37741554/article/details/87560823 linux下载安装node.js 链接2:https://blog.csd ...
- 【资源分享】Gmod-Expression2 - 自定义像素画生成
*作者:BUI* 可自定义制作属于你的像素画(默认为Sans) 第77行的COLOR可编辑你想要的颜色(RGB值) 1,2,3,4分别代表第77行所定义的颜色(0代表不显示) 视频地址:传送链接 @n ...