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 ...
随机推荐
- 小白学 Python 爬虫(24):2019 豆瓣电影排行
人生苦短,我用 Python 前文传送门: 小白学 Python 爬虫(1):开篇 小白学 Python 爬虫(2):前置准备(一)基本类库的安装 小白学 Python 爬虫(3):前置准备(二)Li ...
- MySQL数据库 | 数据表的增删改查
MySQL数据的增删改查(crud) 本文结构 一.增加 create 二.修改 update 三.查询 retrieve(简单查询,下篇详细展开) 四.删除 delete 首先,创建简单的class ...
- JSON对比XML
相同点 纯文本 具有“自我描述性”(人类可读) 具有层级结构 可通过JavaScript解析 数据可使用AJAX传输 不同点 没有结束标签 更短 读写速度更快 能够使用内建的JavaScript ev ...
- winform学习(3)窗体事件
窗体的常用事件 事件可以理解为用户的操作,如点击鼠标键盘 应用程序需要在事件发生时进行响应,因此事件分为: 注册事件:必须为对象注册事件才会被执行(如为某控件添加一个单击的事件) 触发事件:注册后的事 ...
- winform学习(8)RichTextBox控件
RichTextBox控件允许用户输入和编辑文本的同时提供了比普通的TextBox控件更高级的格式特征. RichTextBox的控件标识符.SelectionColor = Color.Blue; ...
- Linux(Ubuntu)服务器是否安装ssh,使用xshell远程连接
1.查看 ssh 是否启动,如果有 sshd 说明已经启动 sudo ps -e | grep ssh 2.启动 ssh 服务 sudo service ssh start 3.如果第二步没有成功启动 ...
- 执行ifconfig eth2 up命令报错eth2: unknown interface: No such device的解决思路
排查问题思路 一般出现这种状况都是网卡mac地址错误引起的!要么网卡配置文件中的mac地址不对,要么/etc/udev/rules.d/70-persistent-net.rules文件中的mac地址 ...
- JS高级---面向对象的编程思想(贪吃蛇梳理)
面向对象的编程思想(贪吃蛇梳理) 模拟贪吃蛇游戏,做的项目 地图: 宽,高,背景颜色,因为小蛇和食物都是相对于地图显示的, 这里小蛇和食物都是地图的子元素, 随机位置显示, 脱离文档流的, 地图也需要 ...
- 第二十五篇 玩转数据结构——链表(Linked List)
1.. 链表的重要性 我们之前实现的动态数组.栈.队列,底层都是依托静态数组,靠resize来解决固定容量的问题,而"链表"则是一种真正的动态数据结构,不需要处理固定容 ...
- Bugku-CTF之web8(txt????)
Day29