开发者

object choice field in blackberry

I want to make an ObjectChoice field have fixed length. But by default ObjectChoice length is based on the content length.

For example if the content is "Choice 1", "Choice Choice Choice 1", the ObjectChoice field takes a different length depending on the 开发者_如何学Pythonselected choice.


Use this sample/example:

String choices[] = {"0","1","2","3","4"};

ObjectChoiceField choice1 = new ObjectChoiceField("", choices, ""){         
    public void layout(int width, int height){
        width = 80;
        super.layout(getWidth(), getHeight());
        super.layout(width, height);
        setExtent(width, super.getHeight());
    }
};
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜