如何将焦点设置在位图字段上,蓝色不可见,黑莓
我正在使用包含小图像的位图字段。
当焦点位于该图像上时,不会出现焦点的蓝色,我如何设置焦点宽度和高度
我的代码::
contract_image_field = new BitmapField(contract_image,Field.FOCUSABLE)
{
public void getFocusRect(XYRect rect)
{
rect.width=0;
rect.height=0;
//super.getFocusRect(rect);
}
protected void onFocus(int direction)
{
myScreen.this.invalidate();
super.onFocus(direction);
}
protected void onUnfocus()
{
myScreen.this.invalidate();
super.onUnfocus();
}
};
contract_image_field.setBitmap(contract_image);
这是我使用图像字段的方式,
虽然我的图像是可点击的,但我看不到蓝色(我想要,请帮忙!!!)
改变 getFocusRect 中的宽度和高度值甚至不能解决问题
i am using a bitmap field that contains a small image.
when focus comes on that image then blue color of the focus does not appears,how can i set the focus width and height
my code::
contract_image_field = new BitmapField(contract_image,Field.FOCUSABLE)
{
public void getFocusRect(XYRect rect)
{
rect.width=0;
rect.height=0;
//super.getFocusRect(rect);
}
protected void onFocus(int direction)
{
myScreen.this.invalidate();
super.onFocus(direction);
}
protected void onUnfocus()
{
myScreen.this.invalidate();
super.onUnfocus();
}
};
contract_image_field.setBitmap(contract_image);
this is the way how i work with image field,
though my image is clickable but i cant see that blue color(i want that please help!!!)
changing values of width and height in getFocusRect does not even solves the problem
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您还可以避免增加场地范围;
使用以下代码:
You can also avoid increasing the field extent;
using the following code:
实际上焦点就在那里,但你看不到,因为焦点区域与场的整个范围相同。如果你想看到焦点矩形,请增加视野范围。
actually focus is there but you can't see because focus region is the same as the field's entire extent. if you want to see focus rect increase the field extent.
阿什拉夫的建议是正确的,只是我会尽量避免在每次绘制焦点调用时设置“空间”。
只需调用 setSpace(int, int) 成员在相关的 bitmapField 上一次。
Ashraf's suggestion is correct, only I would try to avoid setting the 'space' on every drawFocus call.
just call setSpace(int, int) member once on the bitmapField in question.