Android的4X1部件尺寸 [英] Android 4x1 widget size

查看:143
本文介绍了Android的4X1部件尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发支持部件尺寸4X1,4×2 5×2和应用程序。一切正常除了4×1窗口小部件需要4x2widget的大小。我已经检查了小部件提供文件,它似乎确定:

I am developing an application that supports widget sizes 4x1, 4x2 and 5x2. Everything works well except that the 4x1 widget takes the size of a 4x2widget. I have checked the widget provide file and it seems ok:


布局也是正常(我试图改变它的宽度和高度FILL_PARENT其他一些人建议),但无论我做了,当我把它放在主屏幕上,它有一个4X1大小,但它垂直居中上在屏幕上的4×2的尺寸。这就像布局的大小是正确的(我添加了一个背景颜色,看看它是如何的高点),但事情是强迫小部件的大小4×2。

The layout also is ok (I Have tried changing its width and height to fill_parent as some other people suggested) but whatever I did, when I put it on the home screen, it has a 4x1 size but it is centered vertically on a 4x2 size on the screen. It is like the size of the layout is correct (I have added a background color to see how high it is) but something is forcing the widget to size 4x2.

任何人都知道这个问题可能是什么?

Anyone know what the problem could be?

推荐答案

设置了minHeight值40dp解决了这个问题。

Setting the minHeight value to 40dp solved the problem.

这篇关于Android的4X1部件尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆