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 ...
随机推荐
- Mac升级后如何查看自己的网络端口
OS X 10.9 下面 网络实用工具 从实用工具目录里消失了,可能这个程序用的人太少就取消了吧.但是对于做互联网的人还是有点用的. 参考http://www.mamicode.com/info-de ...
- Python_初识函数
为什么要用函数 现在python届发生了一个大事件,len方法突然不能直接用了... 然后现在有一个需求,让你计算'hello world'的长度,你怎么计算? 这个需求对于现在的你其实不难,我们一起 ...
- STL初探
关于STL的一些东西 感言: 学C++不学STL函数库的人可能都是... 有点问题 头文件<algorithm>的一些东西 sort,快排: 这是个初学者必需掌握的东西,及其好用,因为方( ...
- 1.rest之@Get和@Post请求的区别:
区别: (1)@Get 一般用于查询或获取资源信息, @Post一般是用于更新资源信息. (2)Url不同, @Get 请求的url: http://localhost:8080/imeter-cms ...
- 微信环境中如何实现跳转到手机默认外部浏览器下载apk文件
由于微信的限制,应用文件在内置浏览器中下载全部被屏蔽掉,造成很多人用微信扫描二维码下载时点击下载按钮没反应,我想到的是做一个提示用户在浏览器中打开下载.其实原来很简单,就是判断当前是在微信内置浏览器中 ...
- scss(sass)
- 以管理员身份运行 Microsoft Edge 时不支持登录
之前一直用 edge chromium bate版本 一直不能登录 今天试了正式版 还是这样 然后百度一大堆没找到解决方案 设置兼容性为windown7 是可以的 但是 UI显示会有问题 再次打开 又 ...
- 随笔js
js中的函数定义之后,函数名就是这个函数(JS中函数其实也是对象)的地址(句柄) js读取函数内存地址: 首先想读内存地址只有C或者C++,汇编抛开不谈,其他高级语言一般都封装起来了,不过我也不能确定 ...
- Educational Codeforces Round 82 (Rated for Div. 2)E(DP,序列自动机)
#define HAVE_STRUCT_TIMESPEC #include<bits/stdc++.h> using namespace std; ],t[]; int n,m; ][]; ...
- selenium的定位方法-多元素定位
在实际工作中,有些时候定位元素使用ID.NAME.CLASS_NMAE.XPATH等方法无法定位到具体元素,会发现元素属性有很多一致的,这个时候使用单元素定位方法无法准确定位到具体元素,例如,百度首页 ...