setFullScreenMode(true)有问题

steven123oscar 2009-04-02 10:11:05
2.5的模拟器,setFullScreenMode(true)放在Canvas的构造函数中,模拟器下面一栏只有中间变为白色,两边没有变化?什么原因呢
...全文
314 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
Zous000888 2010-07-30
  • 打赏
  • 举报
回复
应该放在你的commandAction中...
To~fu 2009-04-22
  • 打赏
  • 举报
回复
我遇到过,我记得好像这个问题是,你继承了诺基亚的fullcanvas类。
你可以改成继承javax.microedition.lcdui.Canvas;类,再使用setFullScreenMode(true)就成了
Zedee 2009-04-15
  • 打赏
  • 举报
回复
全屏功能在不同手机上的表现都是不同的,一般要用对应公司自己的开发包
FS-Leehom 2009-04-05
  • 打赏
  • 举报
回复
先设置全屏!然后获取屏幕的宽、高,最后调用paint()方法就是全屏的!
this.setFullScreenMode(true);
width = this.getWidth();
height = this.getHeight();
「已注销」 2009-04-03
  • 打赏
  • 举报
回复
应该是你设置了全屏,又addCommand了,导致左右Command的位置显示异常
网络咖啡 2009-04-03
  • 打赏
  • 举报
回复
我的WTK2.5.2也有这个这个问题!!!
愤怒的大闸蟹 2009-04-03
  • 打赏
  • 举报
回复
[Quote=引用楼主 steven123oscar 的帖子:]
2.5的模拟器,setFullScreenMode(true)放在Canvas的构造函数中,模拟器下面一栏只有中间变为白色,两边没有变化?什么原因呢
[/Quote]

WTK的模拟器屏幕大小不是通过手机样子决定的,而是通过配置文件.
在对应模拟器的文件夹中都有一个.properties文件,把这个文件用记事本打开,可以看到以下的类似信息:

## screen properties ##

# Screen size in pixels
###############
screen.width=240 --------------->这是模拟器全屏幕的宽度
screen.height=320 --------------->这是模拟器全屏幕的高度

# The region of the screen available to graphics commands
# This section is optional. It defines the drawable region
# of the screen to be a subregion of the whole screen area.
###############
screenPaintableRegion.x=0
screenPaintableRegion.y=10
screenPaintableRegion.width=240 --------------->这是模拟器实际非全屏幕的宽度。
screenPaintableRegion.height=290 --------------->这是模拟器实际非全屏幕的宽度。


touch_screen=false --------------->是否支持触摸屏,改为true表示支持,默认不支持。


修改最上面4个值就能正常全屏了。
愤怒的大闸蟹 2009-04-03
  • 打赏
  • 举报
回复
[Quote=引用楼主 steven123oscar 的帖子:]
2.5的模拟器,setFullScreenMode(true)放在Canvas的构造函数中,模拟器下面一栏只有中间变为白色,两边没有变化?什么原因呢
[/Quote]

WTK的模拟器屏幕大小不是通过手机样子决定的,而是通过配置文件.
在对应模拟器的文件夹中都有一个.properties文件,把这个文件用记事本打开,可以看到以下的类似信息:

## screen properties ##

# Screen size in pixels
###############
screen.width=240 --------------->这是模拟器全屏幕的宽度
screen.height=320 --------------->这是模拟器全屏幕的高度

# The region of the screen available to graphics commands
# This section is optional. It defines the drawable region
# of the screen to be a subregion of the whole screen area.
###############
screenPaintableRegion.x=0
screenPaintableRegion.y=10
screenPaintableRegion.width=240 --------------->这是模拟器实际非全屏幕的宽度。
screenPaintableRegion.height=290 --------------->这是模拟器实际非全屏幕的宽度。


touch_screen=false --------------->是否支持触摸屏,改为true表示支持,默认不支持。


修改最上面4个值就能正常全屏了。
yangc_83 2009-04-03
  • 打赏
  • 举报
回复
也看看,repaint()函数
heting1024 2009-04-02
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 kf156 的回复:]
贴出paint方法的内容,这样比较好判断
要不可能性比较多,如:
1.你paint方法里只将下面一栏的中间部分有填充白色
2.用到了setClip方法导致两边没变化
3.屏幕宽高你是在setFullScreenMode(true)之前得到
……
[/Quote]
up
kf156 2009-04-02
  • 打赏
  • 举报
回复
贴出paint方法的内容,这样比较好判断
要不可能性比较多,如:
1.你paint方法里只将下面一栏的中间部分有填充白色
2.用到了setClip方法导致两边没变化
3.屏幕宽高你是在setFullScreenMode(true)之前得到
……
alexyu_yxj 2009-04-02
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 kf156 的回复:]
贴出paint方法的内容,这样比较好判断
要不可能性比较多,如:
1.你paint方法里只将下面一栏的中间部分有填充白色
2.用到了setClip方法导致两边没变化
3.屏幕宽高你是在setFullScreenMode(true)之前得到
……
[/Quote]
我感觉第三种可能最应该被注意了
package Level; import Handler.Handler; import Main.Main; import Midlet.Midlet; import Pic.GifDecoder; import java.io.IOException; import java.util.Random; import javax.microedition.lcdui.Display; import javax.microedition.lcdui.Image; import javax.microedition.lcdui.game.GameCanvas; import javax.microedition.lcdui.game.LayerManager; import javax.microedition.lcdui.game.TiledLayer; public class Level3 extends GameCanvas implements Runnable{ public boolean end=false; private int state=0; private LayerManager LM; private TiledLayer TL; private TiledLayer Mess; private TiledLayer Board; private Image pintu; private int screen=1; //三幅图的切换显示 /*1为打乱的图片,2为原图,3为拼凑板*/ private boolean moving; //只是放置 private int move=0; //移动的图块序号 private int origin=0; //拼图板的原始图块序号 private boolean replacing; //交换 private int r11,r12; private int r21,r22; private int count=0; //拼图吻合的数目 private int[][]temp; //记录随机混乱的数组 private int[][]dst; //拼图数据 private int x1,y1; //随机图中的移动左上坐标 private int i1,j1; //相对坐标 private int x2,y2; //版图中的移动左上坐标 private int i2,j2; //相对坐标 private int x,y; //作为移动的统一处理 private int frameGif=0; private static int X=4; private static int Y=8; public Level3(){ super(false); setFullScreenMode(true); Display.getDisplay(Midlet.instance).setCurrent(this); Main.instance.pause=true; Main.g=getGraphics(); new Thread(this).start(); }

13,100

社区成员

发帖
与我相关
我的任务
社区描述
Java J2ME
社区管理员
  • J2ME社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧