Alan Lai
Alan Lai

Reputation: 1104

how to achieve this UI?

This is what I want:

Desired UI

I had created the top red layout by this

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);
}

}

What is the similar of textview in blackberry? is it labeltext?

Upvotes: 0

Views: 68

Answers (1)

Himanshu Sharma
Himanshu Sharma

Reputation: 26

Use threee layout managers, one for the header that is the red part on top,use second layout manager and add a listfield in it override ListField paint method for row ....and use ToolbarManager for the below tab bar

Upvotes: 1

Related Questions