I have a class that extends from ButtonField :
class BitmapButtonField extends ButtonField
{
private Bitmap _bitmap;
private int _buttonWidth;
pr
In paint() to define x offset for image there is a code:
int x = (getPreferredWidth() - _bitmap.getWidth()) >> 1;
It is ok, still button can have other size, because of:
protected void layout(int width, int height)
{
setExtent(Math.min( width, getPreferredWidth()),
Math.min( height, getPreferredHeight()));
}
Try to use
protected void layout(int width, int height)
{
setExtent(getPreferredWidth(), getPreferredHeight());
}