【问题标题】:How to add a custom image to a textfield in blackberry?如何将自定义图像添加到黑莓中的文本字段?
【发布时间】:2011-07-16 19:33:47
【问题描述】:

尝试将背景图像添加到文本字段,但是当用户输入并进入水平滚动时,图像似乎被复制,导致它看起来如下所示:

基本上,我希望第一个文本字段在用户输入大值后看起来像第二个。我有一个扩展 Horizo​​ntalfieldManager 的类,在我的绘制函数中如下:

protected void paint(Graphics g)
{
    g.clear();
    if (mLabelMode)
    {
        g.setColor(mLabelColor);
    }
    else
    {
        g.setColor(mColor);
    }

    int x = this.getHorizontalScroll();

    g.drawImage(x, 0, mBackground.getWidth(), mBackground.getHeight(), mBackground, 0, 0, 0);

    super.paint(g);
}

任何帮助将不胜感激。

【问题讨论】:

    标签: blackberry textfield horizontalfieldmanager


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多