0
我有一个网格,我将内容添加到ir。问题是这些项目会滚动到网格布局之外。我希望物品在网格内,不要超出它。以下是代码片段。黑莓网格问题
gridbackManager = new VerticalFieldManager(
VerticalFieldManager.NO_HORIZONTAL_SCROLL |
VerticalFieldManager.VERTICAL_SCROLL) {
protected void paintBackground(Graphics graphics) {
int c = graphics.getColor();
graphics.setColor(Color.WHITESMOKE);
graphics.fillRect(0, 0, bip.getWidth(), bip.getHeight());
graphics.setColor(c);
super.paintBackground(graphics);
}
protected void sublayout(int maxWidth, int maxHeight) {
int width = bip.getWidth();
int height = bip.getHeight();
super.sublayout(width, height);
setExtent(width, height);
}
};
这里的bip是一个大小为290 * 220的位图。我的屏幕尺寸是320 * 240。所以网格不覆盖整个屏幕,但它的一部分。
你以为超越什么意思?你必须滚动才能看到元素? – 8vius
@arunabha:你的意思真的不清楚。在这种情况下,你有什么和你想要的截图是必须的。另外,为了将来,请尝试以适当的方式格式化您的文本/代码(我们是这里的人,而不是编译器)。 –