如何使黑莓圆角的边框定制TextBoxField? [英] How to make a custom TextBoxField with rounded border on Blackberry?

查看:142
本文介绍了如何使黑莓圆角的边框定制TextBoxField?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要做的黑莓textboxField带圆角的边框。
我尝试做一个自定义的文本框,但它似乎并不好。
任何人都可以分享我的好习惯TextBoxField一类的黑莓?


解决方案

 最后的位图header_Bitmap = //背景图片;
    VerticalFieldManager vfm_ =新VerticalFieldManager(
            Manager.NO_HORIZONTAL_SCROLL | Manager.NO_HORIZONTAL_SCROLLBAR
                    | Manager.NO_VERTICAL_SCROLL
                    | Manager.NO_VERTICAL_SCROLLBAR | Field.USE_ALL_WIDTH){
        公共无效漆(图形图像){
            graphics.setBackgroundColor(0x040811);
            graphics.clear();
            graphics.drawBitmap(0,0,header_Bitmap.getWidth(),
                    header_Bitmap.getHeight(),header_Bitmap,0,0);
            super.paint(图形);
        }
    };

 位图borderBitmap = //圆形图像;
        VerticalFieldManager vfm_email =新VerticalFieldManager();
        vfm_email.setBorder(BorderFactory.createBitmapBorder(新XYEdges(5,5,
                5,5),borderBitmap));
        EmailAddressEditField电子邮件=新EmailAddressEditField(电子邮件,,50,Field.FOCUSABLE);
        vfm_email.add(电子邮件);
        vfm_.add(vfm_email);
        加(vfm_);

I need make a textboxField on Blackberry with rounded border. I try make a custom textbox but it seem not good. Can anybody share me a class for good custom TextBoxField on Blackberry ?

解决方案

final Bitmap header_Bitmap = //background image;
    VerticalFieldManager vfm_ = new VerticalFieldManager(
            Manager.NO_HORIZONTAL_SCROLL | Manager.NO_HORIZONTAL_SCROLLBAR
                    | Manager.NO_VERTICAL_SCROLL
                    | Manager.NO_VERTICAL_SCROLLBAR | Field.USE_ALL_WIDTH) {
        public void paint(Graphics graphics) {
            graphics.setBackgroundColor(0x040811);
            graphics.clear();
            graphics.drawBitmap(0, 0, header_Bitmap.getWidth(),
                    header_Bitmap.getHeight(), header_Bitmap, 0, 0);
            super.paint(graphics);
        }
    };

 Bitmap borderBitmap = //the rounded image;
        VerticalFieldManager vfm_email = new VerticalFieldManager();
        vfm_email.setBorder(BorderFactory.createBitmapBorder(new XYEdges(5, 5,
                5, 5), borderBitmap));
        EmailAddressEditField email = new EmailAddressEditField("Email : ", "", 50, Field.FOCUSABLE);
        vfm_email.add(email);
        vfm_.add(vfm_email);
        add(vfm_);

这篇关于如何使黑莓圆角的边框定制TextBoxField?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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