日期:2014-05-20  浏览次数:20773 次

如果为控件添加背景
使用高级UI但是想改变背景有没有办法?
或者相同的效果,有没有实现的办法。

------解决方案--------------------
高级控件不行啊
------解决方案--------------------
高级UI不行的吧.
------解决方案--------------------
用CANVAS自己画
------解决方案--------------------
继承CustomItem


Constructor Summary
protected CustomItem(String label)
Superclass constructor, provided so that the CustomItem subclass can specify its label.
Method Summary
int getGameAction(int keyCode)
Gets the game action associated with the given key code of the device.
protected int getInteractionModes()
Gets the available interaction modes.
protected abstract int getMinContentHeight()
Implemented by the subclass to return the minimum height of the content area, in pixels.
protected abstract int getMinContentWidth()
Implemented by the subclass to return the minimum width of the content area, in pixels.
protected abstract int getPrefContentHeight(int width)
Implemented by the subclass to return the preferred height of the content area, in pixels.
protected abstract int getPrefContentWidth(int height)
Implemented by the subclass to return the preferred width of the content area, in pixels.
protected void hideNotify()
Called by the system to notify the item that it is now completely invisible, when it previously had been at least partially visible.
protected void invalidate()
Signals that the CustomItem 's size and traversal location need to be updated.
protected void keyPressed(int keyCode)
Called by the system when a key is pressed.
protected void keyReleased(int keyCode)
Called by the system when a key is released.
protected void keyRepeated(int keyCode)
Called by the system when a key is repeated.
protected abstract void paint(Graphics g, int w, int h)
Implemented by the subclass to render the item within its container.
protected void pointerDragged(int x, int y)
Called by the system when a pointer drag action (for example, pen motion after a press but before a release) has occurred within the item.
protected void pointerPressed(int x, int y)
Called by the system when a pointer down action (for example, a pen tap) has occurred within the item.
protected void pointerReleased(int x, int y)
Called by the system when a pointer up action (for example, a pen lift) has occurred after a pointer down action had occurred within the item.
protected void repaint()
Called by subclass code to request that the item be repainted.
protected void repaint(int x, int y, int w, int h)
Called by subclass code to request that the specified rectangular area of the item be repainted.
protected void showNotify()
Called by the system to notify the item that it is now at least partially visible, when it previously had been completely invisible.
protected void sizeChanged(int w, int h)
Implemented by the subclass in order to handle size change events.
protected boolean traverse(int dir, int viewportWidth, int viewportHeight, int[] visRect_inout)
Called by the system when traversal has entered the item or has occurred within the item.
protected void traverseOut()
Called by the system when traversal has occurred out of the item.