【问题标题】:how to achieve this UI?如何实现这个 UI?
【发布时间】:2012-06-05 06:13:38
【问题描述】:

这就是我想要的:

我通过这个创建了顶部的红色布局

public class Custom_TopField extends VerticalFieldManager {
private static final int FIELD_HEIGHT = 70;

private String _text;

Custom_TopField(int color, String text) {
    super(Manager.NO_VERTICAL_SCROLL);
    _text = text;

    Background background = BackgroundFactory.createSolidBackground(color);
    setBackground(background);
}

protected void sublayout(int width, int height) {
    width = Math.min(width, getPreferredWidth());
    height = Math.min(height, getPreferredHeight());
    setExtent(width, height);
}

public int getPreferredHeight() {
    return FIELD_HEIGHT;
}

public int getPreferredWidth() {
    return Display.getWidth();
}

public void paint(Graphics graphics) {
    int rectHeight = getPreferredHeight();
    int rectWidth = getPreferredWidth();

    Font font = Font.getDefault().derive(Font.BOLD, 35);
    graphics.setFont(font);
    graphics.setColor(Color.WHITE);
    graphics.drawRect(0, 0, rectWidth, rectHeight);
    graphics.drawText(_text, rectWidth * 4 / 9, 10);
    super.paint(graphics);
}

}

黑莓中的textview有什么相似之处?是标签文本吗?

【问题讨论】:

  • 相当于LabelField

标签: blackberry


【解决方案1】:

使用三个布局管理器,一个用于顶部红色部分的标题,使用第二个布局管理器并在其中添加一个列表字段覆盖行的 ListField 绘制方法 ....并为下面的选项卡栏使用 ToolbarManager

【讨论】:

    猜你喜欢
    • 2015-09-11
    • 1970-01-01
    • 2012-06-15
    • 1970-01-01
    • 2011-07-25
    • 1970-01-01
    • 1970-01-01
    • 2011-11-25
    • 2022-08-10
    相关资源
    最近更新 更多