开发者

j2me CustomItem disable traversal disable select

开发者 https://www.devze.com 2023-03-11 20:55 出处:网络
I\'ve got a CustomItem which is embedded in a Form. This CustomItem simply draws some text, so I don\'t want to have this CustomItem clickable/selectable by the user.

I've got a CustomItem which is embedded in a Form.

This CustomItem simply draws some text, so I don't want to have this CustomItem clickable/selectable by the user.

StringItems have a boolean skipTraverse + shouldSkipTraverse, which seems to implement this behaviour. It seems this isn't universal - simply adding those booleans to my CustomItem doesn't help.

Any ideas?

"The CustomItem need not support internal traversal at all. It can do this by returning false to the initial call to the traverse method. (This is the default behavior if this method hasn't been overridden by the CustomItem.) If this occurs, the system must arrange for the u开发者_StackOverflow中文版ser to be able to traverse onto and past this item. The system must also arrange for proper scrolling to take place, particularly if the item exceeds the height of the screen, regardless of whether internal traversal is occurring."

protected boolean traverse(int dir,
        int viewportWidth,
        int viewportHeight,
        int[] visRect_inout) {
    return false;
}

Still lets me click this item on a Nokia phone.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号