viewport

egret用eui地图滚动

天涯浪子 提交于 2019-11-27 12:58:33
var group = new eui.Group(); var img = new eui.Image("resource/assets/bg.jpg"); group.addChild(img); //创建一个Scroller var myScroller = new eui.Scroller(); //注意位置和尺寸的设置是在Scroller上面,而不是容器上面 myScroller.width = 400; myScroller.height = 400; //设置viewport myScroller.viewport = group; this.addChild(myScroller); var shang:egret.Shape = new egret.Shape; shang.graphics.beginFill( 16033 ); shang.graphics.drawRect( 80, 460, 60,60 ); shang.graphics.endFill(); shang.touchEnabled=true; shang.addEventListener(egret.TouchEvent.TOUCH_TAP,bshang,this); this.addChild(shang);//将bg添加到舞台上 function bshang(){ myScroller

How is the meta viewport tag used, and what does it do?

别等时光非礼了梦想. 提交于 2019-11-27 11:45:14
问题 What browsers support this meta tag? How do i use it? Does this mean it will solve all my mobile resizing problems? If anyone could answer this it would be a great help to newbies learning <meta="viewport"> 回答1: The viewport browser support is a little bit across the board. I'll point you to the Quirksmode page for viewport browser support for the full details. You use the viewport meta tag like any other meta tag. Put the code block straight up in the <head> . Pretty much, but again, a

Mobile Safari Viewport - Preventing Horizontal Scrolling?

拈花ヽ惹草 提交于 2019-11-27 11:37:46
问题 I'm trying to configure a viewport for mobile Safari. Using the viewport meta tag, I am trying to ensure that there's no zooming, and that you can't scroll the view horizontally. This is the meta tag I'm using: <meta id="viewport" name="viewport" content ="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" /> On my iPhone when I load the page, it seems to look okay: But I can scroll horizontally, so that it looks like this (this is as far to the right as I can go:

Calculating Viewport Height on Chrome Android with CSS

谁说胖子不能爱 提交于 2019-11-27 11:20:04
问题 So I noticed that mobile Chrome calculates the address bar into the viewport height. Because of this using height: 100vh on an element doesn't work because when the address bar scrolls the viewport height changes. I was actually able to find a question that had the same issue here on ios, but after investigating further I realized that this happens on all mobile Chrome browsers. When the address bar scrolls out of the viewport and then again when scrolls into the viewport, the viewport height

How to use multiple viewports in OpenGL?

拜拜、爱过 提交于 2019-11-27 11:10:30
问题 I need to show the same object in OpenGL in two different viewports, for instance, one using ortographic projection and the other using perspective. In order to do this, do I need to draw again the object after each call to glViewport()? 回答1: Nehe has a good tutorial on how to do this, and his site is generally a good resource for OpenGL questions. 回答2: // normal mode if(!divided_view_port) glViewport(0, 0, w, h); else { // right bottom glViewport(w/2, h/2, w, h); glLoadIdentity (); gluLookAt

iPad layout scales up when rotating from portrait to landscape

可紊 提交于 2019-11-27 10:08:33
I have a added to the "viewport" meta tag "width=device-width,initial-scale=1.0" and on an iPad the page loads up fine in landscape mode, the it switches nicely to portrait and when I rotate it back to landscape it scales the page up and I have to pinch zoom it back to a 1 scale. I can fix this by adding the "maximum-scale=1.0, user-scalable=no" , but I was wondering if there is a way I could fix this without taking away from the user the ability to zoom in the page. If you have any suggestions I would love to hear them, Thanks! ------ Update ------ This is not an issue anymore in iOS7. And

5、事例五:视口变换(Viewport)

两盒软妹~` 提交于 2019-11-27 10:06:10
namespace sharpGLTest05 { public partial class SharpGLForm : Form { public SharpGLForm() { InitializeComponent(); } private void openGLControl_OpenGLDraw(object sender, RenderEventArgs e) { OpenGL gl = openGLControl.OpenGL; gl.Clear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT); gl.LoadIdentity(); display(gl); } void display(OpenGL gl) { gl.Color(1.0, 0.0, 0.0); /* * Viewport()函数,可以将透视投影、正射投影等类似的视景体显示到屏幕指定的区域内 * 默认情况下,视口就是你用来绘制3D图像的整个矩形区域 * 1)Viewport定义了视口在窗口中的区域,同时也规定看二维像素平面到视口区域的映射关系 * 2)可以利用Viewport()生成多窗口效果 * Viewport(0,0,w/2,h/2); 左下角 * Viewport(w/2,0,w/2,h/2); 右下角 * Viewport(0

解决iPhone X的一些问题

喜夏-厌秋 提交于 2019-11-27 10:05:05
前言 iPhoneX 取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 fixed 定位的元素)。 笔者通过查阅了一些官方文档,以及结合实际项目中的一些处理经验,整理了一套简单的适配方案分享给大家,希望对大家有所帮助,以下是处理前后效果图: 适配之前需要了解的几个新知识 安全区域 安全区域指的是一个可视窗口范围,处于安全区域的内容不受圆角(corners)、齐刘海(sensor housing)、小黑条(Home Indicator)影响,如下图蓝色区域: 也就是说,我们要做好适配,必须保证页面可视、可操作区域是在安全区域内。 更详细说明,参考文档: Human Interface Guidelines - iPhoneX viewport-fit iOS11 新增特性,苹果公司为了适配 iPhoneX 对现有 viewport meta 标签的一个扩展,用于设置网页在可视窗口的布局方式,可设置三个值: contain: 可视窗口完全包含网页内容(左图) cover:网页内容完全覆盖可视窗口(右图) auto:默认值,跟 contain 表现一致 注意:网页默认不添加扩展的表现是 viewport-fit

Extjs MVC开发模式详解

谁都会走 提交于 2019-11-27 09:35:57
在JS的开发过程中,大规模的JS脚本难以组织和维护,这一直是困扰前端开发人员的头等问题。Extjs为了解决这种问题,在 Extjs 4 .x版本中引入了MVC开发模式,开始将一个JS(Extjs)应用程序分割成Model-View-Controller三层,为JS应用程序的如何组织代码指明了方向,同时使得大规模JS代码变得更加易于重用和维护;这就是 Extjs MVC 开发模式的初衷。 在官方给出的MVC例子中,我们可以看到一个简单的列表编辑功能,这篇文章就围绕这个功能进行详细的讲解,让我们一起来揭开Extjs MVC的神秘面纱! 常规开发模式下的列表编辑功能实现 我们先来看一下这个例子,它的功能非常简单:在页面打开的时候加载一个列表,当双击列表中一行数据的时候打开编辑窗口,编辑完成之后点击保存按钮,然后更新列表。截图如下: extjs-mvc-in-detail 在常规的开发模式下,要实现这个功能非常简单,代码如下: Ext.onReady(function () { //1.定义Model Ext.define("MyApp.model.User", { extend: "Ext.data.Model", fields: [ { name: 'name', type: 'string' }, { name: 'age', type: 'int' }, { name:

Difference between visual viewport and layout viewport?

帅比萌擦擦* 提交于 2019-11-27 09:05:06
问题 What is the Difference between visual viewport and layout viewport for a mobile device like iPhone/iPad? I have gone through a lot of online resources, but am still unclear about it. 回答1: The visual viewport is the part of the page that’s currently shown on-screen. The layout viewport can be considerably wider than the visual viewport, and contains elements that appear and do not appear on the screen. Imagine the layout viewport as being a large image which does not change size or shape. Now