phonegap中设置横向全屏

来源:互联网 发布:多点触摸软件 编辑:程序博客网 时间:2024/06/04 19:27
横向
在AndroidManifest.xml下

在Activity中添加 android:screenOrientation="landscape" 或者你想要的屏幕

全屏
andirod
导入
import android.view.Window;
import android.view.WindowManager;


 public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.main);
        this.setFullScreen();
        super.loadUrl("file:///android_asset/www/index.html");
        
    }
    
  //全屏(无标题栏和状态栏)  
    public void setFullScreen() {  
         getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);//清除FLAG  
         requestWindowFeature(Window.FEATURE_NO_TITLE);  
         getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,  
                        WindowManager.LayoutParams.FLAG_FULLSCREEN);  
    } 

 

ios,iphone

//setStatusBarHidden:withAnimation:
// [[UIApplication sharedApplication] setStatusBarHidden:YES];

[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
原创粉丝点击