This is an automated email from the ASF dual-hosted git repository.

moshen pushed a commit to branch draft
in repository https://gitbox.apache.org/repos/asf/incubator-weex-site.git


The following commit(s) were added to refs/heads/draft by this push:
     new 4655caa  Update integrate-to-iOS, add "Using Weex on iPad".
4655caa is described below

commit 4655caaabc2563735150a6b766b7c8488ee12f50
Author: wqyfavor <[email protected]>
AuthorDate: Sat Feb 9 19:55:59 2019 +0800

    Update integrate-to-iOS, add "Using Weex on iPad".
---
 docs/guide/develop/integrate-to-iOS-app.md    | 22 ++++++++++++++++++++++
 docs/zh/guide/develop/integrate-to-iOS-app.md | 21 +++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/docs/guide/develop/integrate-to-iOS-app.md 
b/docs/guide/develop/integrate-to-iOS-app.md
index aef6b11..10d683b 100644
--- a/docs/guide/develop/integrate-to-iOS-app.md
+++ b/docs/guide/develop/integrate-to-iOS-app.md
@@ -99,3 +99,25 @@ You should destroy the Weex instance explicitly using 
`[instance destroyInstance
 ## 5. Extend Weex
 
 You can extend Weex functionality by writing your own components, modules. For 
more details please refer to [Extend iOS](../extend/extend-ios.html) and 
[Extend iOS with swift](../extend/extend-ios-with-swift.html).
+
+## 6. Using Weex on iPad
+
+When a page finishes rendering, then the screen rotates, the page will not 
adjust automatically.
+So if your App allows screen orientation changing, you must update 
screen-width before rendering.
+
+CSS styles will be converted using **screen-width** and **view-port-width of a 
page**.
+
+view-port-width is 750px by default.
+```javascript
+beforeCreate(){
+    const meta = weex.requireModule('meta');
+    meta.setViewport({
+        width: 1536
+    });
+}
+```
+
+Observe UIDeviceOrientationDidChangeNotification notification and update 
screen size. We presume that screen rotation is done and [UIScreen 
mainScreen].bounds.size.width gives the current screen width.
+```Objective-C
+[WXCoreBridge setDeviceSize:[UIScreen mainScreen].bounds.size];
+```
diff --git a/docs/zh/guide/develop/integrate-to-iOS-app.md 
b/docs/zh/guide/develop/integrate-to-iOS-app.md
index 178c8b2..f6a7944 100644
--- a/docs/zh/guide/develop/integrate-to-iOS-app.md
+++ b/docs/zh/guide/develop/integrate-to-iOS-app.md
@@ -106,3 +106,24 @@ Weex 支持自定义组件、模块,可以参考以下两篇文档。
 
 * [Extend iOS](../extend/extend-ios.html)
 * [Extend iOS with swift](../extend/extend-ios-with-swift.html)
+
+## 6. 在 iPad 中使用 Weex
+
+当页面渲染完成后,屏幕再旋转,页面不会自动适配。所以,如果你的 App 允许屏幕旋转,务必在页面渲染前更新屏幕宽度。
+
+前端样式中指定的坐标在渲染时会根据 **屏幕宽度** 和 **当前页面的 view-port-width** 进行换算。
+
+修改 view-port-width 的方法,会影响前端代码,通常不要设置,默认为 750px。
+```javascript
+beforeCreate(){
+    const meta = weex.requireModule('meta');
+    meta.setViewport({
+        width: 1536
+    });
+}
+```
+
+监听 UIDeviceOrientationDidChangeNotification 
通知,并调用下面方法修改屏幕尺寸(假设已经旋转完成,[UIScreen mainScreen].bounds.size.width 就是当前宽度)
+```Objective-C
+[WXCoreBridge setDeviceSize:[UIScreen mainScreen].bounds.size];
+```

Reply via email to