It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center




已关闭8年。





我需要在Blackberry上制作一个带有圆角边框的textboxField。
我尝试制作一个自定义文本框,但效果似乎不佳。
谁能在Blackberry上给我分享一个自定义TextBoxField的类?

最佳答案

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

09-13 00:53